-
Notifications
You must be signed in to change notification settings - Fork 5
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
refactor: Move epsilon_closure
and nfa_to_dfa
from Lexer
class to Dfa
class.
#62
Open
SharafMohamed
wants to merge
442
commits into
y-scope:main
Choose a base branch
from
SharafMohamed:fixed-tagged-dfa
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+896
−933
Open
Changes from 24 commits
Commits
Show all changes
442 commits
Select commit
Hold shift + click to select a range
59cc6cd
Add nullptr checks.
SharafMohamed 8097a69
Merge branch 'meaningful-tags' into fixed-tagged-nfa
SharafMohamed 9fc41c0
Change Tag class functionality to reflect how registers will be used.
SharafMohamed 6e5c968
Add register class.
SharafMohamed e185fe2
Seperate classes from RegexDFA.hpp and RegexDFA.tpp into their own .h…
SharafMohamed 54357af
Cleanup NFA and DFA classes.
SharafMohamed 2379280
Change RegexDFA to Dfa.
SharafMohamed 8fe9d1e
Change REGEX_DFA to DFA.
SharafMohamed a768ae3
Change DFAStateType to DfaStateType.
SharafMohamed 9fcd7cc
RegexNFA -> Nfa.
SharafMohamed b112a25
UTF8 -> Utf8.
SharafMohamed 653038f
Remove unneeded this->.
SharafMohamed 815ac73
Use auto where possible.
SharafMohamed cc532c8
Remove nonterminal namespace inside of nonterminal.
SharafMohamed 1a1655a
Merge branch 'remove-redundant-typenames' into remove-regex-prefix
SharafMohamed dae03e5
Merge branch 'remove-regex-prefix' into remove-uneeded-this
SharafMohamed 76ef76f
Merge branch 'remove-uneeded-this' into use-auto
SharafMohamed 70362d1
Use auto where possible for all = operators.
SharafMohamed 039eec9
Change positive end transitions from a vector to an optional scalar.
SharafMohamed d060bc6
Temp fix for unit-test until future PR where Tag ptrs are stored in v…
SharafMohamed f041a37
Swap from set to vector to tag pointers to ensure determinism.
SharafMohamed f72e120
Better test coverage for tag class.
SharafMohamed d5ac1ad
Use constant iterators for elements that should not change.
SharafMohamed 30f03ed
Use braced intiailization in test-tag.cpp.
SharafMohamed d386fc0
Use const& for insertion function that can't use move semantics.
SharafMohamed d77d17d
Refactor nfa_to_dfa().
SharafMohamed 4024c3e
Have get_name() return string_view; Update headers.
SharafMohamed 22c3b82
Remove const from member variable.
SharafMohamed ed55534
Remove const from member variable.
SharafMohamed 534afce
Run linter.
SharafMohamed 61fdb5d
Add move semantic test cases.
SharafMohamed 78e5fe8
Add PositiveTaggedTransition docstring and make m_tag throw if ever n…
SharafMohamed 630d882
Delete unused operators.
SharafMohamed 543f8af
Move null check into intiailizer list for NegativeTaggedTransition co…
SharafMohamed ec342fc
Remove position vectors from Tag, as they arent used in the AST.
SharafMohamed af86281
RegexASTCapture enforces non-null arguments; Add docstring to RegexAS…
SharafMohamed 738becd
Capitalize exceptions.
SharafMohamed 789263e
Use () to fix linting issue.
SharafMohamed 1f15ca7
Keep default copy assignment.
SharafMohamed 7688c24
Move @throw to constructor docstrings.
SharafMohamed 27618b2
Merge branch 'meaningful-tags' into fixed-tagged-nfa
SharafMohamed 867d27c
Merge branch 'fixed-tagged-nfa' into register
SharafMohamed aff5bca
Merge branch 'register' into individual-dfa-files
SharafMohamed 7195f57
Merge branch 'individual-dfa-files' into remove-redundant-typenames
SharafMohamed 1b1460b
Merge branch 'remove-redundant-typenames' into remove-regex-prefix
SharafMohamed 486190a
Do string_viee comparisomn in lexer test.
SharafMohamed ac75909
Use string_view compares in tag tests.
SharafMohamed 090f18c
Update headers in TaggedTransition.hpp.
SharafMohamed c7cfc10
Seperate copy and move constructor unit-tests.
SharafMohamed 91b8b51
Use NOTE for class requirements.
SharafMohamed fcb1a76
Use NOTE for class requirements.
SharafMohamed 9b09e19
Use NOTE for class requirements.
SharafMohamed 2f712e6
Merge branch 'meaningful-tags' into fixed-tagged-nfa
SharafMohamed 75aecc4
Update install-catch2.sh to compile catch2 with c++17.
SharafMohamed 9302b94
Merge branch 'main' into fixed-tagged-nfa
SharafMohamed 97caabb
Merge branch 'catch2-install-fix' into fixed-tagged-nfa
SharafMohamed 507a7d3
Loop over end_transitions correctly.
SharafMohamed 34c227b
Add TagPositions class.
SharafMohamed 27c8560
Remove new class, going to add it later.
SharafMohamed 86caa9b
Add const back in.
SharafMohamed 338638e
Add more const back in.
SharafMohamed a742601
Add more const back in.
SharafMohamed d358713
Linter.
SharafMohamed 43870ea
Add more const back in.
SharafMohamed b827a6c
Merge branch 'fixed-tagged-nfa' into register
SharafMohamed f941607
Use `auto`.
SharafMohamed aad9eb3
Fix spacing.
SharafMohamed a801bf8
Add diagram for capture group NFA.
SharafMohamed 08b7548
Add const for consitency with constructor.
SharafMohamed 449133e
Update positive end transition to be optional instead of a vector.
SharafMohamed 7b837bf
Rename new_state function correctly.
SharafMohamed f0eb56b
Update capture group AST state creation.
SharafMohamed a945915
Encapsulate new state for capture group.
SharafMohamed c757ded
Fix compiler error.
SharafMohamed 2eb7477
Use singular for end transition getter function.
SharafMohamed 08060ed
Void to auto -> void.
SharafMohamed 0c2c1d1
Update new_capture_group_start_states to new_capture_group_states to …
SharafMohamed b0b951a
Linter.
SharafMohamed 3c2a2ab
Update docstring for .
SharafMohamed 98c5b95
Rename to new_start_and_end_states_with_positively_tagged_transitions.
SharafMohamed f59cf41
Rename to capture_X_state.
SharafMohamed 85a2d69
Update docstring.
SharafMohamed 4c602d4
Updated diagram to match vars used in code.
SharafMohamed 2b01433
Rename vars to serialized_X.
SharafMohamed e37b29a
Run Linter.
SharafMohamed c5beca3
Fix typo.
SharafMohamed fe4a7b3
Update diagram for capture group NFA.
SharafMohamed 8993088
Merge branch 'fixed-tagged-nfa' into register
SharafMohamed aaf720a
Merge branch 'main' into register
SharafMohamed 0017512
Add register unit-tests, add PrefixTree with unit-tests.
SharafMohamed 336f2ae
Finished with initial register implementation.
SharafMohamed 3449df2
Linter.
SharafMohamed ef62df1
Linter.
SharafMohamed a085650
Docstring fixes.
SharafMohamed 2be06c0
Add boundry test case.
SharafMohamed 9ec01dd
Improve test cases for setting positions in prefix tree.
SharafMohamed 019e675
Improve test cases for setting invalid positions in prefix tree.
SharafMohamed 83a411a
Remove confusing description; Remove unused include.
SharafMohamed c88fbb5
Add edge case test to register unit-tests.
SharafMohamed 7c91ddc
Update docstring for PrefixTreeNode.
SharafMohamed 4c50769
Add comments to test-case; Add new test case for setting root value.
SharafMohamed 98200b4
Update docstring to make it clear that any negative value of m_positi…
SharafMohamed afaf01a
Fix header gaurd.
SharafMohamed 8dea476
Fix typo.
SharafMohamed dbb1e16
Remove newline in docstring.
SharafMohamed e054825
Improve throw consistency.
SharafMohamed 792ce96
Update prefix tree insertion test cases.
SharafMohamed cab6e81
Fix test case.
SharafMohamed ffda5e6
Fix @throws doscstring for consistency; Improve insert() docstring.
SharafMohamed ff11672
Improve register handler test coverage.
SharafMohamed 536b50b
Fix == ordering in test-cases; Fix vector initialization to remove re…
SharafMohamed 77c20f7
Add const for consistency.
SharafMohamed f43759c
Add _HPP to header guards; Remove unused include.
SharafMohamed 01e8881
Fix typo.
SharafMohamed fbb3d36
Remove blank line.
SharafMohamed e1f2b18
Rename to m_prefix_tree; Remove unused include.
SharafMohamed a51b49d
Add param descriptions to docstrings.
SharafMohamed 002577e
Improve out of range check to be consistent.
SharafMohamed 52a155c
Update set docstring.
SharafMohamed a6beafc
Punctuate docstrings.
SharafMohamed ec1f757
Update PregixTreeNode docstring.
SharafMohamed f35741f
Improve docstring for PrefixTree.
SharafMohamed e8e5e55
Change to use auto -> void; Punctuate out_of_range throws.
SharafMohamed f1ece30
Update Register docstring.
SharafMohamed 08997ae
Update PrefixTree docstring.
SharafMohamed 0910c62
Grammar fix.
SharafMohamed ede680e
Grammar fix.
SharafMohamed c7b047c
Use auto where possible.
SharafMohamed 6fa8fcb
Use uniform initialization.
SharafMohamed 18b9160
Add missing header.
SharafMohamed 3f08fa3
Linter.
SharafMohamed e281f04
Fix spacing.
SharafMohamed a03734e
Make Node a member of PrefixTree.
SharafMohamed 9123c7a
Rename index to prefix_tree_node_id.
SharafMohamed fe35fe0
Make it clear indicies in add_register are refering to prefix_tree no…
SharafMohamed de58e08
Linter.
SharafMohamed 1426179
rename to reg_id.
SharafMohamed 3301f14
Rename to reg_id.
SharafMohamed c9b1369
Use at().
SharafMohamed 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 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 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 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 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 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 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 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 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize
m_bytes_transition
to prevent undefined behaviourThe array
m_bytes_transition
contains pointers that are not automatically initialized, which may lead to undefined behaviour when accessing uninitialized pointers. It's crucial to initialize this array to ensure all elements start asnullptr
.Apply this diff to add a constructor that initializes
m_bytes_transition
:📝 Committable suggestion