Closed geraldstanje closed 9 years ago
isn't the yacc source generated by ebnf2y?
ql.y
is generated automatically from the godocs using ebnf2y to verify the EBNF of the QL specification is structurally complete and correct.
parser.y
originated as a copy of ql.y
and since then it was manually edited to its present state.
what did you manually add to the parser.y file? wouldnt it be less work to manually write the .y file?
a) This emphasizes the manual edits.
$ cd $GOPATH/src/github.com/cznic/ql
$ gvimdiff ql.y parser.y
b) I don't think so. The generated from EBNF parser is a nice skeleton to start with. YMMV, though.
Assuming I can close the issue, but please feel free to ask here if you want.
hi, i modified the yacc file... can you give me some feedback to the general design? i still need to add tests and split the packages... https://github.com/geraldstanje/toycompiler
i would also like to add function, if statements and variables ... im not sure how to implement scoping in the code generator...any thoughts? in the following example there are 2 varDecl's. so when i see the FuncCall Node foo, i need to lookup for the varDecl a in the main scope to assign it to?
e.g. void foo(int a) { print a; }
int main() { int a = 2; foo(a); }
Hi,
could you upload some examples which uses goyacc together with golex?
Thanks, Gerald