c_to_python.git
5 months agoUpdate Makefile to make it compile with recent pilex master
Nick Downing [Mon, 13 Nov 2023 11:20:55 +0000 (22:20 +1100)]
Update Makefile to make it compile with recent pilex

2 years agoMinor update to walk AST via node.children[i] instead of node[i]
Nick Downing [Mon, 27 Dec 2021 06:42:54 +0000 (17:42 +1100)]
Minor update to walk AST via node.children[i] instead of node[i]

4 years agoUpdate to use the installed pitree/pilex/piyacc including the new --install-element...
Nick Downing [Sun, 26 Jan 2020 23:55:25 +0000 (10:55 +1100)]
Update to use the installed pitree/pilex/piyacc including the new --install-element switch to pitree

4 years agoImplement storage classes
Nick Downing [Sun, 19 Jan 2020 06:49:23 +0000 (17:49 +1100)]
Implement storage classes

4 years agoHandle some more expressions and statements, add cpp "# line file" extractor
Nick Downing [Sun, 19 Jan 2020 03:54:17 +0000 (14:54 +1100)]
Handle some more expressions and statements, add cpp "# line file" extractor

4 years agoUpdate hacky hard coded paths to pilex/piyacc/pitree, add struct translation
Nick Downing [Sun, 19 Jan 2020 03:08:36 +0000 (14:08 +1100)]
Update hacky hard coded paths to pilex/piyacc/pitree, add struct translation

5 years agoUpdate to pitree.git commit e4f3cdd
Nick Downing [Tue, 29 Jan 2019 05:21:12 +0000 (16:21 +1100)]
Update to pitree.git commit e4f3cdd

5 years agoUpdate to pitree.git commit 350e5a9
Nick Downing [Tue, 29 Jan 2019 04:44:42 +0000 (15:44 +1100)]
Update to pitree.git commit 350e5a9

5 years agoUpdate to pitree.git commit 5cba525
Nick Downing [Tue, 29 Jan 2019 02:00:31 +0000 (13:00 +1100)]
Update to pitree.git commit 5cba525

5 years agoUse ansi_c.t, get rid of old AST generator and stripper
Nick Downing [Mon, 28 Jan 2019 03:19:31 +0000 (14:19 +1100)]
Use ansi_c.t, get rid of old AST generator and stripper

5 years agoRemove obsolete __repr__() and repr_serialize() on AST elements, change spacing
Nick Downing [Sun, 27 Jan 2019 11:29:58 +0000 (22:29 +1100)]
Remove obsolete __repr__() and repr_serialize() on AST elements, change spacing

5 years agoRemove obsolete way of initializing AST elements with serialized (string) data
Nick Downing [Sat, 26 Jan 2019 23:29:54 +0000 (10:29 +1100)]
Remove obsolete way of initializing AST elements with serialized (string) data

5 years agoMinor adjustment since recent change to bootstrap_bison.git markup generation
Nick Downing [Thu, 24 Jan 2019 12:03:50 +0000 (23:03 +1100)]
Minor adjustment since recent change to bootstrap_bison.git markup generation

5 years agoImprove 'switch' translation so that 'case' and 'default' can be used together
Nick Downing [Fri, 18 Jan 2019 02:00:17 +0000 (13:00 +1100)]
Improve 'switch' translation so that 'case' and 'default' can be used together

5 years agoFine tune whitespace, which node tags are translated, addition of braces, etc
Nick Downing [Thu, 17 Jan 2019 23:13:58 +0000 (10:13 +1100)]
Fine tune whitespace, which node tags are translated, addition of braces, etc

5 years agoFirst cut at translating parse-gram.y from Bison, fix ANSI C switch statement
Nick Downing [Wed, 16 Jan 2019 05:35:56 +0000 (16:35 +1100)]
First cut at translating parse-gram.y from Bison, fix ANSI C switch statement

5 years agoFirst cut at translating scan-code.l and scan-gram.l from Bison, do more ANSI C
Nick Downing [Wed, 16 Jan 2019 02:05:41 +0000 (13:05 +1100)]
First cut at translating scan-code.l and scan-gram.l from Bison, do more ANSI C

5 years agoNormalize whitespace and indent in *.y.new, fix various conversion bugs
Nick Downing [Mon, 14 Jan 2019 07:09:28 +0000 (18:09 +1100)]
Normalize whitespace and indent in *.y.new, fix various conversion bugs

5 years agoFirst cut at y_to_python.py, need to normalize whitespace and indent in *.y.new
Nick Downing [Mon, 14 Jan 2019 03:54:58 +0000 (14:54 +1100)]
First cut at y_to_python.py, need to normalize whitespace and indent in *.y.new

5 years agoFix minor booboos in C concatenated strings and scan_to_l.py macro text removal
Nick Downing [Mon, 14 Jan 2019 02:51:30 +0000 (13:51 +1100)]
Fix minor booboos in C concatenated strings and scan_to_l.py macro text removal

5 years agoFix up postprocessing so that 'y_tab.' is inserted but not 'DFA.' or 'LR1DFA.'
Nick Downing [Sun, 13 Jan 2019 11:37:17 +0000 (22:37 +1100)]
Fix up postprocessing so that 'y_tab.' is inserted but not 'DFA.' or 'LR1DFA.'

5 years agoGet l_to_python working again, implement more necessary features such as sizeof
Nick Downing [Sun, 13 Jan 2019 11:27:41 +0000 (22:27 +1100)]
Get l_to_python working again, implement more necessary features such as sizeof

5 years agoTranslate expressions properly, with parentheses depending on precedence, translate...
Nick Downing [Sun, 13 Jan 2019 07:02:44 +0000 (18:02 +1100)]
Translate expressions properly, with parentheses depending on precedence, translate if/else, for, while, do/while, continue, break statements in emulated way

5 years agoTranslate declarations properly, initialized to an initializer expression, a type...
Nick Downing [Sun, 13 Jan 2019 00:36:21 +0000 (11:36 +1100)]
Translate declarations properly, initialized to an initializer expression, a type-appropriate zero expression if at top level, or None (temporarily disable translation of statements since we now output lines directly, rather than an AST)

5 years agoAdd type analysis system from ansi_c.py in regex.git with some slight updates
Nick Downing [Sat, 12 Jan 2019 23:04:51 +0000 (10:04 +1100)]
Add type analysis system from ansi_c.py in regex.git with some slight updates

5 years agoUse full grammar with %start translation_unit_opt, wrap action code in a dummy functi...
Nick Downing [Sat, 12 Jan 2019 13:01:09 +0000 (00:01 +1100)]
Use full grammar with %start translation_unit_opt, wrap action code in a dummy function to compensate, improve translation of functions and block statements

5 years agoReinstate the translation based on the new pilex/piyacc parser, tidy up a bit
Nick Downing [Sat, 12 Jan 2019 03:12:16 +0000 (14:12 +1100)]
Reinstate the translation based on the new pilex/piyacc parser, tidy up a bit

5 years agoChange to use pilex and piyacc with (?E{...}...) style AST generation rather than...
Nick Downing [Thu, 10 Jan 2019 22:11:31 +0000 (09:11 +1100)]
Change to use pilex and piyacc with (?E{...}...) style AST generation rather than the older style plex and pyacc, add a Makefile, remove a lot of useless cruft

5 years agoMinor adjustments, change xml_to_l.py to scan_to_l.py, make it fix token names
Nick Downing [Sun, 12 Aug 2018 02:14:30 +0000 (12:14 +1000)]
Minor adjustments, change xml_to_l.py to scan_to_l.py, make it fix token names

5 years agoTranslate more C constructs, categorize identifiers and add (self|yy). prefixes to... origin/master
Nick Downing [Sun, 12 Aug 2018 00:33:55 +0000 (10:33 +1000)]
Translate more C constructs, categorize identifiers and add (self|yy). prefixes to some of them, indent the containing flex source as well as the Python source

5 years agoImplement basic Python translation, mainly indenting/spacing, handle some expressions...
Nick Downing [Sun, 5 Aug 2018 12:01:12 +0000 (22:01 +1000)]
Implement basic Python translation, mainly indenting/spacing, handle some expressions and statements specially, in particular add logic for do/while loops etc

5 years agoMake it invoke the C preprocessor only once with all the actions, and correctly subst...
Nick Downing [Sun, 5 Aug 2018 01:57:56 +0000 (11:57 +1000)]
Make it invoke the C preprocessor only once with all the actions, and correctly substitute macros, deleting the preprocessed results of includes before parsing

5 years agoFirst cut at l_to_python.py translator which reads a lex specification (in XML format...
Nick Downing [Sun, 5 Aug 2018 00:59:05 +0000 (10:59 +1000)]
First cut at l_to_python.py translator which reads a lex specification (in XML format for now), and then passes each action through c_to_python.py to translate