pilex.git
5 years agoImplement element groups with support from pilex (not via user code) origin/master
Nick Downing [Wed, 26 Sep 2018 07:27:28 +0000 (17:27 +1000)]
Implement element groups with support from pilex (not via user code)

5 years agoUpdate skel_py_element.py, implement tests_ast directory which defines AST_Num(_Manti...
Nick Downing [Wed, 26 Sep 2018 07:02:34 +0000 (17:02 +1000)]
Update skel_py_element.py, implement tests_ast directory which defines AST_Num(_Mantissa|_Fraction)? elements and builds yy_element_token using action groups

5 years agoImplement numbered and named groups with support from pilex (not via user code)
Nick Downing [Wed, 26 Sep 2018 05:33:33 +0000 (15:33 +1000)]
Implement numbered and named groups with support from pilex (not via user code)

5 years agoRearrange so that group actions don't need any arguments, implement group names
Nick Downing [Tue, 25 Sep 2018 23:51:19 +0000 (09:51 +1000)]
Rearrange so that group actions don't need any arguments, implement group names

5 years agoImplement action groups (extension syntax), use this to make a private implementation...
Nick Downing [Tue, 25 Sep 2018 23:20:48 +0000 (09:20 +1000)]
Implement action groups (extension syntax), use this to make a private implementation of numbered groups in cal_py.l, extract parts of floating point by groups

5 years agoMove Rule.post_process() code into EOFRule, FLexRule to avoid isinstance() test
Nick Downing [Sat, 22 Sep 2018 01:29:41 +0000 (11:29 +1000)]
Move Rule.post_process() code into EOFRule, FLexRule to avoid isinstance() test

5 years agoSet tag name for yy_element_(space|token) to something sensible, we use 'root'
Nick Downing [Thu, 13 Sep 2018 11:14:57 +0000 (21:14 +1000)]
Set tag name for yy_element_(space|token) to something sensible, we use 'root'

5 years agoFirst cut at automatic AST generation with pilex.py --element switch
Nick Downing [Wed, 12 Sep 2018 13:01:53 +0000 (23:01 +1000)]
First cut at automatic AST generation with pilex.py --element switch

5 years agoImprove the Python skeleton to implement REJECT(), unput(), yyless() and so on
Nick Downing [Tue, 11 Sep 2018 11:24:31 +0000 (21:24 +1000)]
Improve the Python skeleton to implement REJECT(), unput(), yyless() and so on

5 years agoRename plex to pilex, rename PLex object and prefix to AST
Nick Downing [Tue, 11 Sep 2018 05:17:21 +0000 (15:17 +1000)]
Rename plex to pilex, rename PLex object and prefix to AST

5 years agoAdd --python switch, skel/skel_py.py template, and tests/cal_py.l test scanner
Nick Downing [Sun, 9 Sep 2018 04:22:13 +0000 (14:22 +1000)]
Add --python switch, skel/skel_py.py template, and tests/cal_py.l test scanner

5 years agoRename skeleton to skel_flex.c, include skel_flex.c in repository instead of requirin...
Nick Downing [Fri, 10 Aug 2018 12:28:32 +0000 (22:28 +1000)]
Rename skeleton to skel_flex.c, include skel_flex.c in repository instead of requiring bootstrap_flex, fix a bug defining 'yy' prefix in wrong place in ast.py

5 years agoMove FlexDFA generation into DFA.to_flex_dfa() consistent with other generators,...
Nick Downing [Wed, 8 Aug 2018 05:20:23 +0000 (15:20 +1000)]
Move FlexDFA generation into DFA.to_flex_dfa() consistent with other generators, and skeleton filling code from flex_dfa.py to generate_flex.py

5 years agoMinor fixes to yywrap and how prefixes and outfiles are handled
Nick Downing [Sat, 28 Jul 2018 02:27:39 +0000 (12:27 +1000)]
Minor fixes to yywrap and how prefixes and outfiles are handled

5 years agoImprove handling of %option and %array/%pointer, implement %option prefix=, improve...
Nick Downing [Wed, 25 Jul 2018 15:08:38 +0000 (01:08 +1000)]
Improve handling of %option and %array/%pointer, implement %option prefix=, improve skeleton/patching (more features, removes #line directives before patching)

5 years agoAdd continued actions and %option nodefault, make acclist generation slightly more...
Nick Downing [Tue, 24 Jul 2018 01:20:42 +0000 (11:20 +1000)]
Add continued actions and %option nodefault, make acclist generation slightly more robust, reinstate test code in regex.py which is invoked when run standalone

5 years agoChange numpy.int16 to numpy.uint16 and flex_int16_t to flex_uint16_t everywhere
Nick Downing [Mon, 23 Jul 2018 08:50:03 +0000 (18:50 +1000)]
Change numpy.int16 to numpy.uint16 and flex_int16_t to flex_uint16_t everywhere

5 years agoMake packing of states generate a list of candidates for first slot via numpy
Nick Downing [Mon, 23 Jul 2018 08:49:04 +0000 (18:49 +1000)]
Make packing of states generate a list of candidates for first slot via numpy

5 years agoUse a heap to speed up the minimum spanning tree generation
Nick Downing [Mon, 23 Jul 2018 08:38:21 +0000 (18:38 +1000)]
Use a heap to speed up the minimum spanning tree generation

5 years agoImplement %option caseless, also accept and ignore other options used in scan.l
Nick Downing [Mon, 23 Jul 2018 05:40:06 +0000 (15:40 +1000)]
Implement %option caseless, also accept and ignore other options used in scan.l

5 years agoFix a bug in start condition handling, tidy, fix skeleton, add progress reports
Nick Downing [Mon, 23 Jul 2018 03:26:24 +0000 (13:26 +1000)]
Fix a bug in start condition handling, tidy, fix skeleton, add progress reports

5 years agoEncode states in reverse order (larger distances first)
Nick Downing [Sun, 22 Jul 2018 09:22:35 +0000 (19:22 +1000)]
Encode states in reverse order (larger distances first)

5 years agoAdd Prim's minimal spanning tree algorithm to encode states in an optimal order
Nick Downing [Sun, 22 Jul 2018 08:27:04 +0000 (18:27 +1000)]
Add Prim's minimal spanning tree algorithm to encode states in an optimal order

5 years agoTidying up
Nick Downing [Sun, 22 Jul 2018 06:30:15 +0000 (16:30 +1000)]
Tidying up

5 years agoCompute all state-to-state distances ahead of time then refer to them
Nick Downing [Sun, 22 Jul 2018 06:18:50 +0000 (16:18 +1000)]
Compute all state-to-state distances ahead of time then refer to them

5 years agoMake better use of numpy.nonzero in compression step, borrowing from pyacc2.git
Nick Downing [Sun, 22 Jul 2018 06:13:44 +0000 (16:13 +1000)]
Make better use of numpy.nonzero in compression step, borrowing from pyacc2.git

5 years agoIntroduce PLex.Section2.Rule.FLexRule which is always a pair of (expr, trailing conte...
Nick Downing [Sun, 22 Jul 2018 04:29:32 +0000 (14:29 +1000)]
Introduce PLex.Section2.Rule.FLexRule which is always a pair of (expr, trailing context) rather than the old scheme which had an optional BOLRule inserted in

5 years agoImplement compound rules
Nick Downing [Sun, 22 Jul 2018 04:18:34 +0000 (14:18 +1000)]
Implement compound rules

5 years agoChange entries from a list of nxt, chk pairs to a numpy array
Nick Downing [Sun, 22 Jul 2018 03:49:41 +0000 (13:49 +1000)]
Change entries from a list of nxt, chk pairs to a numpy array

5 years agoTidying up
Nick Downing [Sun, 22 Jul 2018 03:25:57 +0000 (13:25 +1000)]
Tidying up

5 years agoChange states from a list of base, def pairs to a numpy array
Nick Downing [Sun, 22 Jul 2018 02:26:00 +0000 (12:26 +1000)]
Change states from a list of base, def pairs to a numpy array

5 years agoChange states_accept (as list of lists) to acclist and accept (as numpy arrays)
Nick Downing [Sun, 22 Jul 2018 01:57:33 +0000 (11:57 +1000)]
Change states_accept (as list of lists) to acclist and accept (as numpy arrays)

5 years agoRename full_entries to transition_table, do compression step after construction
Nick Downing [Sun, 22 Jul 2018 01:14:47 +0000 (11:14 +1000)]
Rename full_entries to transition_table, do compression step after construction

5 years agoRemove useless state_to_flex_base_def (can't reuse base, def due to yy_chk[])
Nick Downing [Sun, 22 Jul 2018 01:12:04 +0000 (11:12 +1000)]
Remove useless state_to_flex_base_def (can't reuse base, def due to yy_chk[])

5 years agoChange the semantic analysis pass to only index the rules applicable to each start...
Nick Downing [Sat, 21 Jul 2018 13:07:11 +0000 (23:07 +1000)]
Change the semantic analysis pass to only index the rules applicable to each start condition instead of generating the regex per start condition immediately, allows the semantic analysis result to be serialized without reparenting regexes

5 years agoIntroduce the PLex.Text.get_text() method, and rearrange class hierarchy a bit
Nick Downing [Sat, 21 Jul 2018 12:29:08 +0000 (22:29 +1000)]
Introduce the PLex.Text.get_text() method, and rearrange class hierarchy a bit

5 years agoGet latest regex.py and other modules (since it has been split up) from pyacc2.git...
Nick Downing [Sat, 21 Jul 2018 12:04:59 +0000 (22:04 +1000)]
Get latest regex.py and other modules (since it has been split up) from pyacc2.git commit 740dcdb, fix some bugs where dfa/nfa required a leading underscore

5 years agoAdd https://github.com/gautamkmr/Compiler-Lab- examples
Nick Downing [Sat, 21 Jul 2018 11:50:24 +0000 (21:50 +1000)]
Add https://github.com/gautamkmr/Compiler-Lab- examples

5 years agoMinor improvements to how test programs are built
Nick Downing [Fri, 6 Jul 2018 06:41:49 +0000 (16:41 +1000)]
Minor improvements to how test programs are built

5 years agoChange bracketing of action text so that delimiters are captured within markup
Nick Downing [Mon, 2 Jul 2018 12:02:22 +0000 (22:02 +1000)]
Change bracketing of action text so that delimiters are captured within markup

5 years agoMove CodeBlocks class inside new Section1Or2 class (formerly SectionCodeBlocks),...
Nick Downing [Mon, 2 Jul 2018 07:48:39 +0000 (17:48 +1000)]
Move CodeBlocks class inside new Section1Or2 class (formerly SectionCodeBlocks), also implement %option noyywrap and update the cal test progarm to not use -ll

5 years agoAdd degenerate.py, to strip out generated code and thus make the logic readable
Nick Downing [Sun, 1 Jul 2018 15:04:40 +0000 (01:04 +1000)]
Add degenerate.py, to strip out generated code and thus make the logic readable

5 years agoMove Flex DFA generation into its own module, makes bootstrap_flex.py trivial
Nick Downing [Sun, 1 Jul 2018 14:56:41 +0000 (00:56 +1000)]
Move Flex DFA generation into its own module, makes bootstrap_flex.py trivial

5 years agoFurther rearrangement to put everything inside the PLex class, and move the entire...
Nick Downing [Sun, 1 Jul 2018 14:50:31 +0000 (00:50 +1000)]
Further rearrangement to put everything inside the PLex class, and move the entire source file processing into the post_process() routine, leaves a serialized copy of the regular expression recognized in each start condition in PLex object

5 years agoRearrange AST class structure to use inner class definitions
Nick Downing [Sat, 30 Jun 2018 06:35:52 +0000 (16:35 +1000)]
Rearrange AST class structure to use inner class definitions

5 years agoChange how start conditions are represented in the syntax tree
Nick Downing [Sat, 30 Jun 2018 03:08:23 +0000 (13:08 +1000)]
Change how start conditions are represented in the syntax tree

5 years agoAdd start conditions (AT&T style only), improve EOF rules, add default action
Nick Downing [Sat, 30 Jun 2018 00:22:16 +0000 (10:22 +1000)]
Add start conditions (AT&T style only), improve EOF rules, add default action

5 years agoAdd BOL and EOF rules, not well tested yet
Nick Downing [Fri, 29 Jun 2018 12:43:08 +0000 (22:43 +1000)]
Add BOL and EOF rules, not well tested yet

5 years agoFix issue with transitions/threads and issue with duplicate states (but the generated...
Nick Downing [Thu, 28 Jun 2018 23:48:49 +0000 (09:48 +1000)]
Fix issue with transitions/threads and issue with duplicate states (but the generated tables are definitely suboptimal, need to merge indistinguishable states)

5 years agoMinor bug fixes to get it to scan something, enhance test program to print flex state...
Nick Downing [Thu, 28 Jun 2018 09:51:34 +0000 (19:51 +1000)]
Minor bug fixes to get it to scan something, enhance test program to print flex state machine progression (for comparison against our generated state machine)

5 years agoFirst cut at generating state machines compatible with a generic flex skeleton
Nick Downing [Wed, 27 Jun 2018 14:12:22 +0000 (00:12 +1000)]
First cut at generating state machines compatible with a generic flex skeleton