Customizing semantic analysis for AST nodes
Hi, I have two questions about semantic analysis. Iâm working with expressions a lot now. And I want to highlight them, but I donât want to pay attention for undeclared variables. So in terms of analysis it would be nice to know global variables, but I donât care about having marked others as undeclared. Second thing is more of a disturbing functionality. If you have `ast` variable which is an RBPatternVariableNode and you do `ast doSemanticAnalysis` after that ast may end up being a RBVariableNode. I find this annoying because I donât expect my object to change just because of an analysis. Uko
2016-07-27 15:16 GMT+02:00 Yuriy Tymchuk <yuriy.tymchuk@me.com>:
Hi, I have two questions about semantic analysis.
Iâm working with expressions a lot now. And I want to highlight them, but I donât want to pay attention for undeclared variables. So in terms of analysis it would be nice to know global variables, but I donât care about having marked others as undeclared.
Second thing is more of a disturbing functionality. If you have `ast` variable which is an RBPatternVariableNode and you do `ast doSemanticAnalysis` after that ast may end up being a RBVariableNode. I find this annoying because I donât expect my object to change just because of an analysis.
But it is the same that happens with any global variable. After parsing an expression like RBPatternParser parseExpression:'Morph draw:`arg' Morph is just a RBVariableNode and you need to call #doSemanticAnalysis to get a RBGlobalNode instead. But I guess #doSemanticAnalysis is just not supposed to work with pattern nodes.
Uko
participants (2)
-
Nicolai Hess -
Yuriy Tymchuk