Commit Graph

116 Commits (525296f239ba340c300b7b642a9b147f480c261f)

Author SHA1 Message Date
Aadhavan Srinivasan 525296f239 Added examples for 'FindAllString()' , 'FindAllSubmatch()' and 'FindAllStringSubmatch()' 4 weeks ago
Aadhavan Srinivasan eb0ab9f7ec Wrote test for FindAllStringSubmatch() 4 weeks ago
Aadhavan Srinivasan 17a7dbae4c Wrote FindAllStringSubmatch() 4 weeks ago
Aadhavan Srinivasan f2279acd98 Fixed mistake in docs 4 weeks ago
Aadhavan Srinivasan d1958f289c Commented out tests that would only pass with Longest() 4 weeks ago
Aadhavan Srinivasan 15ee49f42e Rename method receivers from 'regex' to 're' (it's shorter) 4 weeks ago
Aadhavan Srinivasan b60ded4136 Don't break when a match is found, if we are looking for the longest match 4 weeks ago
Aadhavan Srinivasan 9fbb99f86c Wrote example for Longest() 4 weeks ago
Aadhavan Srinivasan af15904f3b Updated documentation 4 weeks ago
Aadhavan Srinivasan d522f50b50 Wrote new example functions 4 weeks ago
Aadhavan Srinivasan fb47e082eb Wrote new methods Expand() and preferLongest(); Use new function signatures (with preferLongest); only characters should be added to next state list 4 weeks ago
Aadhavan Srinivasan 1f5a363539 Use new function signatures (with preferLongest) 4 weeks ago
Aadhavan Srinivasan 9e12f9dcb3 Added field to Reg, denoting if we prefer longest match (POSIX style) or not (perl style) 4 weeks ago
Aadhavan Srinivasan 47f88c817f Fixed typo 4 weeks ago
Aadhavan Srinivasan 835d495990 Removed capitalization for error message (staticcheck) 4 weeks ago
Aadhavan Srinivasan 76e0170cb9 Removed unused function 4 weeks ago
Aadhavan Srinivasan d172a58258 Throw error if match isn't found but test.result has >0 elements 4 weeks ago
Aadhavan Srinivasan 7231169270 Removed unused functions 4 weeks ago
Aadhavan Srinivasan b7467a00f1 Removed priorityQueue (unused) 4 weeks ago
Aadhavan Srinivasan c6ad4caa0d Removed a bunch of unused code (let's go!!!) 4 weeks ago
Aadhavan Srinivasan 6334435b83 Updated tests since the engine uses Perl matching instead of POSIX matching; added tests for FindStringSubmatch 4 weeks ago
Aadhavan Srinivasan 78fb5606dd Use new definition of Reg 4 weeks ago
Aadhavan Srinivasan eddd2ae700 Updated documentation 4 weeks ago
Aadhavan Srinivasan c577064977 Added string field to Reg, that contains the expression string; wrote method to return the string 4 weeks ago
Aadhavan Srinivasan d4e3942d27 Added Match() and FindStringSubmatch(); removed old code; updated comments 4 weeks ago
Aadhavan Srinivasan f15a5cae34 Store all states visited in a single run of 'addStateToList()' in a slice 1 month ago
Aadhavan Srinivasan 62ca1a872a Made zeroLengthMatchState() return a pointer; reduced the number of comparisons performd by nfaState.equals 1 month ago
Aadhavan Srinivasan 99230b49de Use new function signature for zeroLengthMatchState() 1 month ago
Aadhavan Srinivasan 22ead83625 Fixed assertion matching 1 month ago
Aadhavan Srinivasan 3604486a9b Used Pike's algorithm (an extension to Thompson's algorithm) (see Russ Cox's 2nd article); I think I almost have a working PCRE-style engine 1 month ago
Aadhavan Srinivasan 052de55826 question() now returns 2 values 1 month ago
Aadhavan Srinivasan d2ad0d95a8 Modified question operator so that it doesn't create an unnecessary zero-state 1 month ago
Aadhavan Srinivasan ccf3b3b299 More progress on implementing PCRE matching 1 month ago
Aadhavan Srinivasan 1d4f695f8f Wrote function to check if a state is in an nfaState, based on the Equals function 1 month ago
Aadhavan Srinivasan 8534174ea1 Use pointers instead of values 1 month ago
Aadhavan Srinivasan ed4ffde64e REFACTOR NEEDED: Added another special case; insert instead of appending into currentStates 1 month ago
Aadhavan Srinivasan fbc9bea9fb Commented out unused functions; use new nfaState parameters 1 month ago
Aadhavan Srinivasan cca8c7cda2 Got rid of transitions parameter, changed how kleene state is processed
I replaced the transition parameter for nfaState, replacing it with a
single nfaState pointer. This is because any non-alternation state will
only have one next state, so the map was just added complexity.

I changed alternation processing - instead of having their own dedicated
fields, they just use the new 'next' parameter, and another one called
'splitState'.

I also changed the kleene state processing to remove the unecessary
empty state in the right-side alternation (it actually messed up my
matching).
1 month ago
Aadhavan Srinivasan 858e535fba Continued implementing Thompson's algorithm 1 month ago
Aadhavan Srinivasan 7c62ba6bfd Started implementing Thompson's algorithm for matching, because the old one was completely backtracking (so it would enter infinite loops on something like '(a*)*' )
The git diff claims that a ton of code was changed, but most of it was just indentation changes.
1 month ago
Aadhavan Srinivasan d4e8cb74fd Replaced pointer to nfaState with nfaState 1 month ago
Aadhavan Srinivasan 3ce611d121 More work towards implementing PCRE matching 1 month ago
Aadhavan Srinivasan e0253dfaf3 Change kleene() to an alternation-style construct 1 month ago
Aadhavan Srinivasan 753e973d82 Started rewrite of matching algorithm, got concatenation and alternation done, kleene and zero-state stuff is next 1 month ago
Aadhavan Srinivasan 5563a70568 Reverse the order in which I pop states for alternation, because this messes with the left branch-right branch thing 1 month ago
Aadhavan Srinivasan de0d7345a8 Store left and right branches of alternation separately 1 month ago
Aadhavan Srinivasan ad273b0c68 Trying to emulate backtracking by using string pointers within threads (something similar to rsc's 2nd regexp article) 1 month ago
Aadhavan Srinivasan e167cdb2cb Fixed mistake in test output 1 month ago
Aadhavan Srinivasan 1fd48ae614 Store the current string pointer as a 'thread variable' (allows us to simulate backtracking) 1 month ago
Aadhavan Srinivasan fbc9dfcc95 Trying something out; we'll see if it works 1 month ago