Resolve the inconsistant use of node and oper identifiers in the code.
To do that, we : (1) totally remove (in the ocaml code) the use of "oper", and use "node" instead. Indeed, a node is a memoryfull operator, as opposed to function that are memoryless operators. However, lus2lic does not really care about memoryless and memoryfull information. Therefore I prefer to use node everywhere, and to flag node_info to indicate whether it has memories or not. (2) change the syntaxTreeCore type to make it more general. Indeed, the distinction between functions and nodes was - redundant: extern nodes and (extern) functions were handled differently (NodeExtern versus ExtNode (was named FUNC before)). - and incomplete: it was not possible to provide static parameters to function, nor to define functions with body, etc. Now a function is just a memoryless node. The check that function indeed use no memory will be done later. (3) also, change the parser so that functions with body are accepted. (4) in order to do it step by step, I add the "extern" keyword" so that extern nodes and functions are more easy to parse. I will remove it later.
Showing
- src/compile.ml 2 additions, 2 deletionssrc/compile.ml
- src/compiledData.ml 65 additions, 43 deletionssrc/compiledData.ml
- src/expandPack.ml 5 additions, 3 deletionssrc/expandPack.ml
- src/lazyCompiler.ml 25 additions, 13 deletionssrc/lazyCompiler.ml
- src/lexer.mll 3 additions, 0 deletionssrc/lexer.mll
- src/main.ml 2 additions, 2 deletionssrc/main.ml
- src/parser.mly 88 additions, 33 deletionssrc/parser.mly
- src/symbolTab.ml 2 additions, 2 deletionssrc/symbolTab.ml
- src/syntaxTab.ml 7 additions, 7 deletionssrc/syntaxTab.ml
- src/syntaxTreeCore.ml 21 additions, 9 deletionssrc/syntaxTreeCore.ml
- src/syntaxTreeDump.ml 18 additions, 21 deletionssrc/syntaxTreeDump.ml
- src/test/Makefile 3 additions, 0 deletionssrc/test/Makefile
- src/test/func_with_body.lus 12 additions, 0 deletionssrc/test/func_with_body.lus
- src/test/t0.lus 1 addition, 1 deletionsrc/test/t0.lus
- src/test/test.res.exp 165 additions, 136 deletionssrc/test/test.res.exp
Loading
Please register or sign in to comment