comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg @ 16684:d654cd5ed05a

SL/SourceAttribution: further corrections for attributing function bodies
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Fri, 01 Aug 2014 18:10:48 -0700
parents 0fc43b066eee
children 888907296590
comparison
equal deleted inserted replaced
16675:0fc43b066eee 16684:d654cd5ed05a
64 64
65 65
66 Function 66 Function
67 = 67 =
68 "function" 68 "function"
69 identifier (. factory.startFunction(t); .) 69 identifier (. Token identifierToken = t; .)
70 "(" 70 "(" (. int bodyStartPos = t.charPos; .)
71 (. factory.startFunction(identifierToken, bodyStartPos); .)
71 [ 72 [
72 identifier (. factory.addFormalParameter(t); .) 73 identifier (. factory.addFormalParameter(t); .)
73 { 74 {
74 "," 75 ","
75 identifier (. factory.addFormalParameter(t); .) 76 identifier (. factory.addFormalParameter(t); .)
123 . 124 .
124 125
125 126
126 IfStatement<out SLStatementNode result, boolean inLoop> 127 IfStatement<out SLStatementNode result, boolean inLoop>
127 = 128 =
128 "if" 129 "if" (. Token ifToken = t; .)
129 "(" (. Token ifToken = t; .) 130 "("
130 Expression<out SLExpressionNode condition> 131 Expression<out SLExpressionNode condition>
131 ")" 132 ")"
132 Block<out SLStatementNode thenPart, inLoop> (. SLStatementNode elsePart = null; .) 133 Block<out SLStatementNode thenPart, inLoop> (. SLStatementNode elsePart = null; .)
133 [ 134 [
134 "else" 135 "else"