0.23.10
This release is a minor change.
The trtree app was updated with block tree output, and it is now the default. This output style incorporates the Unicode characters for edges. This helps to visually identify what children belong to which parent.
So, for example, with the Arithmetic grammar, and the input string 1+2*3
, the following block tree is produced.
$ trparse -i '1+2*3' | trtree
CSharp 0 string success 0.0237195
file_
├── expression
│ ├── expression
│ │ └── atom
│ │ └── scientific
│ │ └── SCIENTIFIC_NUMBER
│ │ └── "1"
│ ├── PLUS
│ │ └── "+"
│ └── expression
│ ├── expression
│ │ └── atom
│ │ └── scientific
│ │ └── SCIENTIFIC_NUMBER
│ │ └── "2"
│ ├── TIMES
│ │ └── "*"
│ └── expression
│ └── atom
│ └── scientific
│ └── SCIENTIFIC_NUMBER
│ └── "3"
└── EOF
└── ""
12/13-11:05:02 ~/temp7/Generated-CSharp
An interesting note: The code for this was derived from ChatGPT (https://chatgpt.com/share/675ed066-4994-8007-aeee-db755431f6b3). The code had a bug (it listed directories twice, and even when pointed out, could not correct it), but I fixed that, and adapted it from files and directories to parse trees.
In the trgen app, the templates were adjusted to compute and output token stream indices for tokens. The ambiguity for a performance test was updated--ambiguity testing is only available with trperf, and that cannot be computed for any target other than CSharp.
Again, with the Arithmetic grammar, the raw driver produces the following.
$ ./bin/Debug/net8.0/Test.exe -input '1+2*3' -tokens
[@0,0:0='1',<2>,1:0]
[@1,1:1='+',<5>,1:1]
[@2,2:2='2',<2>,1:2]
[@3,3:3='*',<7>,1:3]
[@4,4:4='3',<2>,1:4]
[@5,5:4='<EOF>',<-1>,1:5]
CSharp 0 string0 success 0.0159526
Total Time: 0.1538565
12/13-11:08:00 ~/temp7/Generated-CSharp