0.23.9
This is a minor change.
- Fixed trgen problems with grammar files that end with
st.g4
, e.g.,tst.g4
. Trgen would not create a good driver for the grammar. I included a test to make sure this doesn't regress with a future change. - Fixed the built-in grammar for Bison, so that instead of recursion, kleene closure is used. This cuts back on excessive stack size for parsing some Bison grammars. Here are some example rules that were changed.
token_decls_for_prec
: token_decl_for_prec+
| TAG token_decl_for_prec+
| token_decls_for_prec TAG token_decl_for_prec+
;
symbol_decls
: symbol+
| TAG symbol+
| symbol_decls TAG symbol+
;
bison_grammar
: rules_or_grammar_declaration
| bison_grammar rules_or_grammar_declaration
;
params
: params actionBlock
| actionBlock
;
vs.
token_decls_for_prec
: (token_decl_for_prec+ | TAG token_decl_for_prec+) (TAG token_decl_for_prec+)*
;
symbol_decls
: (symbol+ | TAG symbol+) (TAG symbol+)*
;
bison_grammar
: rules_or_grammar_declaration+
;
params
: actionBlock+
;
- trclonereplace was fixed up to perform proper rule cloning and replacing.
- trextract was added. _I haven't really refind what this command should do. But, essentially, I want to have it extract out actions and replace with macros. I can then add a tool to expand the macros. This code is intended to fix the "target agnostic problem."
- tragl now has "multi-tree" display. Prior to this change, each tree passed via a parsing result set would have to be viewed in order, and closed off each time. Instead, we can now view all the trees simultaneously, and compared. There are two modes for trparse: one to not group, and the other to group. This affects how tragl displays the trees, whether in one "doc" window, or multiple. The default is "ungrouped", i.e., multiple.
12/14-20:44:10 ~/issues/g4-current/c/Generated-CSharp
$ trparse --ambig ../examples/TypeCast.c | tragl
CSharp 0 ../examples/TypeCast.c success 0.071354
12/14-20:44:40 ~/issues/g4-current/c/Generated-CSharp
- trgen templates for performance. The templates for the drivers where changed a little to help in tracing performance issues. For example, instead of
Total Time: 123.123
being displayed, a prefix can be passed in to displaygroup Total Time: 123.123
. This helps with another change for testing performance and extracting out information for statistical analysis. Some of the old double-minus--
syntax fordotnet
calls were fixed as well, as this is not accepted by thedotnet
tool anymore. ThegetAllPossibleParseTrees()
function was changed in the CSharp templates to now return a string corresponding to the "decision/alt" for an ambiguous parse tree that was computed. This helps one to understand where grammar ambiguity resides. This could be considered a "major change", but since most don't use Trash, this isn't a problem. - trglob now produces a list of files and directories with relative paths instead of absolute.