comparison src/buildkeywordtab.c @ 126:ac183a519439

Update parsing scheme with a keyword lookup by token value and other framework Add ability to turn a token code into a keyword string. Also correct some details related to token table generation with some additiona adjustments for token symbols. Also rework token symbol definitions and creation of some parsing tables as well as the main statement parsing loop.
author William Astle <lost@l-w.ca>
date Mon, 08 Jan 2024 22:58:08 -0700
parents 8770e6f977c3
children 5d4801c0566d
comparison
equal deleted inserted replaced
125:0607e4e20702 126:ac183a519439
25 void print_tree(FILE *fp, struct treenode *tn, char *lookahead, int lookaheaddepth) 25 void print_tree(FILE *fp, struct treenode *tn, char *lookahead, int lookaheaddepth)
26 { 26 {
27 struct treenode *tn1; 27 struct treenode *tn1;
28 int depth = ++treedepth; 28 int depth = ++treedepth;
29 29
30 fprintf(fp, "parse_wt%d fdb parse_wt%de-parse_wt%d-2\n", depth, depth, depth); 30 fprintf(fp, "parse_wt%d fdb parse_wt%de-parse_wt%d\n", depth, depth, depth);
31 31
32 for (tn1 = tn -> firstchild; tn1; tn1 = tn1 -> nextsibling) 32 for (tn1 = tn -> firstchild; tn1; tn1 = tn1 -> nextsibling)
33 { 33 {
34 // if there are child nodes, insert the sub tree 34 // if there are child nodes, insert the sub tree
35 if (tn1 -> firstchild) 35 if (tn1 -> firstchild)