Search in sources :

Example 1 with LeaveStatementNodeHelper

use of nl.ramsolutions.sw.magik.analysis.helpers.LeaveStatementNodeHelper in project magik-tools by StevenLooman.

the class LocalTypeReasoner method walkPostLeaveStatement.

@Override
protected void walkPostLeaveStatement(final AstNode node) {
    // Get results.
    final AstNode multiValueExprNode = node.getFirstChild(MagikGrammar.TUPLE);
    final ExpressionResult result = multiValueExprNode != null ? this.getNodeType(multiValueExprNode) : new ExpressionResult();
    // Find related BODY/EXPRESION nodes.
    final LeaveStatementNodeHelper helper = new LeaveStatementNodeHelper(node);
    final AstNode bodyNode = helper.getRelatedBodyNode();
    final AstNode expressionNode = bodyNode.getFirstAncestor(MagikGrammar.EXPRESSION);
    this.addNodeType(expressionNode, result);
}
Also used : LeaveStatementNodeHelper(nl.ramsolutions.sw.magik.analysis.helpers.LeaveStatementNodeHelper) ExpressionResult(nl.ramsolutions.sw.magik.analysis.typing.types.ExpressionResult) AstNode(com.sonar.sslr.api.AstNode)

Aggregations

AstNode (com.sonar.sslr.api.AstNode)1 LeaveStatementNodeHelper (nl.ramsolutions.sw.magik.analysis.helpers.LeaveStatementNodeHelper)1 ExpressionResult (nl.ramsolutions.sw.magik.analysis.typing.types.ExpressionResult)1