-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Separate concept tags from captures and store capture-to-tag mapping in the lexer. #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SharafMohamed
merged 581 commits into
y-scope:main
from
SharafMohamed:restructure-tagging
Feb 13, 2025
Merged
Changes from 250 commits
Commits
Show all changes
581 commits
Select commit
Hold shift + click to select a range
e2aee66
Remove Register class and use uint32_t instead; Rename vers to xxx_re…
SharafMohamed 36c1810
Rename to reg_id.
SharafMohamed 48df8b0
Remove unused header.
SharafMohamed a8605fc
Change pred index to be optional and nullopt for root.
SharafMohamed 15cb1b6
Add and use node_id_t.
SharafMohamed 6b787d0
Add position_t.
SharafMohamed cd8f4e3
Change to id_t.
SharafMohamed 72da50c
Add is_root().
SharafMohamed 3fc7ea7
Add missing header.
SharafMohamed 6443d66
Update PrefixTree docstring.
SharafMohamed 63aec4d
Removing node docstring as its redundant.
SharafMohamed 295f3ee
Combine private section in PrefixTree.
SharafMohamed 1186666
Add missing header; Remove copy paste error.
SharafMohamed 06ee38e
Rename to node_id and parent_node_id.
SharafMohamed e103011
Update get_reversed_positions' docstring.
SharafMohamed 31b0346
Update get_reversed positions' docstring to clarify exlcusivity of th…
SharafMohamed 4005e41
Grammar fix.
SharafMohamed e38940c
Add maybe_unusued.
SharafMohamed d71368d
Update src/log_surgeon/finite_automata/RegisterHandler.hpp
SharafMohamed dd4b6e1
Update test case names to document code names better.
SharafMohamed 7322852
Implicitily use auto in vectors.
SharafMohamed dba1a18
Explicitily use position_t for vectors.
SharafMohamed ee6efab
Update tests/test-register-handler.cpp
SharafMohamed 9ba980c
Switch to size_t.
SharafMohamed 27b324c
Clang-tidy: Remove magic numbers + Fix headers.
SharafMohamed f651a24
Reduce complexity for clang-tidy.
SharafMohamed fc6f426
Add negative pos test case in test-register-handler.cpp.
SharafMohamed c8fb570
Alternate b/w positive and negative positions in test-prefix-tree neg…
SharafMohamed 1f66918
Add cRootId and size() to PrefixTree.
SharafMohamed a388c80
Update note.
SharafMohamed 340eaf7
Update docstring.
SharafMohamed 22cf931
Fix typo.
SharafMohamed e75c888
Merge branch 'register' into individual-dfa-files
SharafMohamed d5b20fe
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed 69a7ad1
Merge branch 'remove-redundant-typenames' into remove-regex-prefix
SharafMohamed 0b7ef3c
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed ada697f
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed 4e08e2c
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 5916d33
Fix errors created by merge, need to still double check all the funct…
SharafMohamed c61f2d9
Update header for size_t.
SharafMohamed 417bde8
Update src/log_surgeon/finite_automata/PrefixTree.hpp
SharafMohamed 738876d
Update src/log_surgeon/finite_automata/PrefixTree.hpp
SharafMohamed 93c03a0
Update src/log_surgeon/finite_automata/RegisterHandler.hpp
SharafMohamed 6481e5f
Update tests/test-prefix-tree.cpp
SharafMohamed 6a9a4a4
Clean up register initialization helper; Fix typo.
SharafMohamed 052d86f
Update get_parent_id to clarify its unsafe and suppress warning.
SharafMohamed ed70bd5
Move constants in test-register-handler.hpp to minimize scope.
SharafMohamed fab801f
Merge branch 'register' into individual-dfa-files
SharafMohamed db84cb7
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed 7f6fcd9
Merge branch 'remove-redundant-typenames' into remove-regex-prefix
SharafMohamed a346104
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed e90ae14
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed 4d30509
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 1671e39
Move constants into scope for test-prefix-tree.cpp.
SharafMohamed 748dfc5
Rename to handler_init and return handler.
SharafMohamed 8abf35a
Add docstring for get_parent_id_unsafe().
SharafMohamed 1e5fdcc
Linter.
SharafMohamed effac53
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed 43aa3be
Linter + Merge branch 'remove-redundant-typenames' into remove-regex-…
SharafMohamed c0920bf
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed 19fe130
Linter.
SharafMohamed 61ceba6
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed 0e1e2b2
Linter.
SharafMohamed 9302ecb
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 71d926d
Merge branch 'register' into individual-dfa-files
SharafMohamed 66ed13b
Merge branch 'main' into individual-dfa-files
SharafMohamed a12a360
Fix comment length.
SharafMohamed 244d122
Initialize byte transitions.
SharafMohamed 176391b
Use const* in place of unique_ptr reference; Update docstrings.
SharafMohamed 012f61f
Update intersect test to compile.
SharafMohamed 96a6363
Update next() docstring.
SharafMohamed 7cd39f0
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed a4a93b4
Rename to state_type.
SharafMohamed 421c3de
Update headers.
SharafMohamed ecd4e4e
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed 1b945a1
Update Lexer headers.
SharafMohamed 70cd43d
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed 78c4125
Add header for conditional_t.
SharafMohamed 3ce0b30
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed 33623fa
Linter.
SharafMohamed bae0557
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed 5bbeafc
Linter.
SharafMohamed 0decaf5
Change ! to false ==.
SharafMohamed 0e2d593
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed cf5980d
Merge branch 'remove-redundant-typenames' into remove-regex-prefix
SharafMohamed 6e65a3e
LALR1Parser to Lalr1Parser.
SharafMohamed 9c2ad81
Linter.
SharafMohamed c4fc96b
Rename templates to TypedDfaState and TypedNfaState.
SharafMohamed a6bbaef
Rename to Utf8*State and Byte*State.
SharafMohamed ff2dac3
Remove RegexDFAStateType.hpp.
SharafMohamed 7a8982d
Linter.
SharafMohamed 7b0a86c
Linter again.
SharafMohamed 2632616
Add missing alogrithm header; Update test-NFA.
SharafMohamed 992a2ec
Update intersect-test.cpp with new names.
SharafMohamed a5419f0
Linter on intersect-test.cpp.
SharafMohamed ae64f64
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed 9153a7c
Switch this->m_lexer to m_lexer by using Parser::m_lexer.
SharafMohamed fa0c098
Linter.
SharafMohamed 845b088
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed 2dd6f45
Lint.
SharafMohamed ee46719
More auto changes.
SharafMohamed 4cebc06
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 827d39c
Merge branch 'main' into remove-redundant-typenames
SharafMohamed 80979de
Remove old epsilon_closure after double checking it matches the moved…
SharafMohamed b38b6d7
Merge dfa_to_nfa() into Dfa::Dfa().
SharafMohamed 1c2d7b3
Merge branch 'remove-redundant-typenames' into remove-regex-prefix
SharafMohamed 11da5d5
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed 3f6966f
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed 11eab2b
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 538ae8b
Fix intersect_test compiler errrors.
SharafMohamed 74841b0
Add const.
SharafMohamed f84cd0b
Add register handler to DFA.
SharafMohamed efb7932
Add missing headers; Initialize variable.
SharafMohamed be3d483
Update src/log_surgeon/finite_automata/RegexDFAStatePair.hpp
SharafMohamed b8afafa
Update src/log_surgeon/finite_automata/RegexNFAState.hpp
SharafMohamed 68ed2b1
Update src/log_surgeon/finite_automata/RegexDFAStatePair.hpp
SharafMohamed 8bebee4
Add maps to lexer; Add lexer test case.
SharafMohamed beb59aa
NonTerminal::m_all_children to m_all_children.
SharafMohamed b4d25bb
Merge branch 'remove-redundant-typenames' of https://github.com/Shara…
SharafMohamed 4e07f8d
Merge branch 'remove-redundant-typenames' into remove-regex-prefix
SharafMohamed 8f7a355
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed fe3b704
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed 1380e53
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 6d5b920
Merge branch 'main' into remove-regex-prefix
SharafMohamed 9a82620
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed 8abd2cf
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed a509323
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 6bf8c01
Fix test-NFA to test-nfa and ByteNFA to ByteNfa.
SharafMohamed 5dc5953
Combine NfaStateType and DfaStateType into StateType.
SharafMohamed ed631b3
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed 8410fb1
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed ff92325
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed b26d22b
Remove out-dated comment.
SharafMohamed 9af72f3
Remove old commented utf8 code.
SharafMohamed 6f3ce6c
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed 1f1d3ea
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed d21e373
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 66cd3b3
Merge branch 'main' into remove-uneeded-this
SharafMohamed ea78ed2
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed 25237a2
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 3a94829
Merge branch 'refactor-nfa-to-dfa' into restructure-tagging
SharafMohamed 9902984
Fix file ordering in tests cmake.
SharafMohamed 7ccdfd5
Merge branch 'main' into use-auto
SharafMohamed 013997c
Explicitly use bool for initializations from true/false instead of auto.
SharafMohamed 88e2cc2
Update src/log_surgeon/Lalr1Parser.tpp
SharafMohamed 4ebbc82
Make bool typed explicitly.
SharafMohamed e6893d9
Update src/log_surgeon/Lalr1Parser.tpp
SharafMohamed 425a8e6
Update src/log_surgeon/Lalr1Parser.tpp
SharafMohamed fd394af
Update src/log_surgeon/Lalr1Parser.tpp
SharafMohamed 7fe39db
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 6cb5c23
Update src/log_surgeon/Lalr1Parser.tpp
SharafMohamed 239872a
Merge branch 'use-auto' into refactor-nfa-to-dfa
SharafMohamed 8bd9bae
Merge branch 'refactor-nfa-to-dfa' into restructure-tagging
SharafMohamed 473f8e5
Merge branch 'main' into refactor-nfa-to-dfa
SharafMohamed 626ad54
Merge branch 'refactor-nfa-to-dfa' into restructure-tagging
SharafMohamed 0fb0758
Update test code.
SharafMohamed f7e1718
Switch typedef to using; Remove commented out code.
SharafMohamed 18c3e25
Merge branch 'refactor-nfa-to-dfa' into restructure-tagging
SharafMohamed af2c8d4
Merge branch 'main' into restructure-tagging
SharafMohamed 3504ffb
Fixed lexer test...the current way of using the lexer is insanely bad.
SharafMohamed 8b43e83
Add capture group test case.
SharafMohamed 719e722
Add getters and setters for lexer maps; Update unit-tests.
SharafMohamed 082145e
Use capture instead of tag.
SharafMohamed e06cf44
Fix ownership of m_rules.
SharafMohamed 2e99a91
Add tags.
SharafMohamed 94db0d6
Lexer now enforced unique capture names.
SharafMohamed 9731fa3
Update test-nfa to match added tags.
SharafMohamed bc78c49
Update the last lexer map that can be initialized currently.
SharafMohamed 2c89216
Uniform initialization.
SharafMohamed f06031d
Indent comment.
SharafMohamed 90ce695
Indent comment.
SharafMohamed 40a90bd
Linter.
SharafMohamed d9c20fe
Linter.
SharafMohamed 391607d
Linter.
SharafMohamed e6273b2
Linter.
SharafMohamed f88a780
Use moe semantics properly for negative transition.
SharafMohamed 0cc6c24
Clean up testing code.
SharafMohamed 54d9181
Move UniqueIdGenerator to its own file.
SharafMohamed d38393d
Fix accidental deletion.
SharafMohamed 4d911af
Lock Ubuntu to 22.04.
SharafMohamed 71fbb9c
Print unit-test logs when failing on git.
SharafMohamed 0aa0f42
Merge branch 'lock-ubuntu-version' into restructure-tagging
SharafMohamed 55272ef
Merge branch 'lock-ubuntu-version' into print-unit-test-on-git
SharafMohamed b32cdc8
Linter fixes.
SharafMohamed 0f9ff50
clang-tidy id gen.
SharafMohamed 7dbe2ea
Merge branch 'print-unit-test-on-git' into restructure-tagging
SharafMohamed 004ba66
Merge branch 'linter-fixes' into restructure-tagging
SharafMohamed 22bc8f6
Merge branch 'main' into restructure-tagging
SharafMohamed 727e63e
Use contains()
SharafMohamed 2cf8bde
Some clang-tidy fixes.
SharafMohamed a17fbf5
rename to get_captures_id_from_var_id.
SharafMohamed efd78f5
rename to get_reg_id_from_tag_id.
SharafMohamed f0c8ec8
Rename to get_tag_ids_from_capture_id; Rename to get_reg_ids_from_cap…
SharafMohamed 4183d06
Replace aliasing with directly using the existing type.
SharafMohamed e45c370
Rename to reg_id_t.
SharafMohamed 13dabb7
Shot-circuit on failure; Don't use [].
SharafMohamed 4a8329f
Merge branch 'restructure-tagging' of https://github.com/SharafMohame…
SharafMohamed 8d427fd
Fix compiler error; Add spacing; Start change for tag_ids to tag_id_p…
SharafMohamed 5370720
Finish rename of tag_ids to tag_id_pair.
SharafMohamed 598dda8
Fix docstring.
SharafMohamed be10a94
New docstrings.
SharafMohamed 50bf97a
Use const; Replace [] with at().
SharafMohamed d79ad47
Fix spacing.
SharafMohamed 6af3a86
Update NFA docstring.
SharafMohamed ea16fd1
Use contains.
SharafMohamed 6a4a440
Add const.
SharafMohamed be7bef3
Remove space after namespace.
SharafMohamed 3ae1016
Add nodiscard.
SharafMohamed aacd497
Undo docstring change for prefix tree.
SharafMohamed e971175
Fix NegativeTaggedTransition docstring,
SharafMohamed 986d767
Replace symbol_id_t with rule_id_t and capture_id_t.
SharafMohamed 439895b
Avoid copy.
SharafMohamed 1efe053
Remove Dfa changes.
SharafMohamed 5c178f6
Remove unused var; Avoid copy.
SharafMohamed 169f21c
Fix std::uint32_t to uint32_t.
SharafMohamed 7ca626e
Fix typo.
SharafMohamed 12ee26f
Replace ! with false.
SharafMohamed 32996b5
Clang-tidy TaggedTransition.hpp.
SharafMohamed 78c9df4
Replace [] with .at() and .emplace(); Use ++i.
SharafMohamed 32f540b
Clean up test-lexer.cpp.
SharafMohamed cc7c0a6
Clean up test-lexer.cpp.
SharafMohamed 15e1384
Add optional prefix.
SharafMohamed fab9c42
Fix compiler error,
SharafMohamed 27ef30b
Add const.
SharafMohamed 2d77ee6
Run linter.
SharafMohamed 40cab9d
Rename group to capture.
SharafMohamed df1c9df
Add Aliases.hpp; Lint.
SharafMohamed ef3bc8e
Add aliases.
SharafMohamed 58a948e
Rename register to reg.
SharafMohamed 481b997
Remove erroneous const.
SharafMohamed ea724e6
Use try_emplace.
SharafMohamed b326a92
Make sure declaration matches definition.
SharafMohamed 0693c1b
Fix typo.
SharafMohamed 85724cb
Rename add_to_nfa_with_negative_captures.
SharafMohamed 5261293
Improve TODO.
SharafMohamed 19856a1
Update initialize lexer docstring.
SharafMohamed 5a72ad5
Update docstring.
SharafMohamed 1217fe6
Improve docstring.
SharafMohamed d5e2e53
Update diagram with ID.
SharafMohamed ebb6abc
Add nullptr checks to body of constructor.
SharafMohamed 630749a
Use contains in Lexer.hpp.
SharafMohamed ddae224
Switch find to contains in TaggedTransition.hpp.
SharafMohamed a2d1825
Add missing header.
SharafMohamed 983ddcb
Rename Aliases.hpp to types.hpp.
SharafMohamed 303de17
initialize_lexer now creates and returns the lexer.
SharafMohamed 9e99f40
Fix compiler error.
SharafMohamed 574d9df
Rename to create_lexer.
SharafMohamed 75de29a
Fix docstring.
SharafMohamed ac43cce
Fix docstring again.
SharafMohamed b9ef282
Fix docstring again again.
SharafMohamed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #ifndef LOG_SURGEON_UNIQUEIDGENERATOR_HPP | ||
| #define LOG_SURGEON_UNIQUEIDGENERATOR_HPP | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| namespace log_surgeon { | ||
| class UniqueIdGenerator { | ||
| public: | ||
| [[nodiscard]] auto generate_id() -> uint32_t { return m_current_id++; } | ||
|
|
||
| private: | ||
| uint32_t m_current_id{0}; | ||
| }; | ||
| } // namespace log_surgeon | ||
|
|
||
| #endif // LOG_SURGEON_UNIQUEIDGENERATOR_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SharafMohamed marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.