use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class Parser method parseExpression.
public Expression parseExpression() {
final Expression _receiver;
final int _start;
_start = st.gravel.support.jvm.ReadStreamExtensions.position(_stream);
this.eatWhitespace();
_receiver = this.parseOperand();
return ((Expression) this.setSourcePosition_node_(_start, this.parseMessageChain_(((Expression) this.setSourcePosition_node_(_start, _receiver)))));
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class KeywordMessageNode method innerSourceSendOn_.
@Override
public KeywordMessageNode innerSourceSendOn_(final StringBuilder _aStream) {
final String[] _keywords;
_keywords = st.gravel.support.jvm.StringExtensions.tokensBasedOn_(_selector, ':');
for (int _i = 1; _i <= _arguments.length; _i++) {
final String _keyword;
final Expression _argument;
_keyword = _keywords[_i - 1];
_argument = _arguments[_i - 1];
if (!st.gravel.support.jvm.IntegerExtensions.equals_(_i, 1)) {
_aStream.append(' ');
}
_aStream.append(_keyword);
_aStream.append(':');
_aStream.append(' ');
_argument.sourceOn_(_aStream);
}
return this;
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class LiteralSendInliner method visitNonLocalReturnNode_.
@Override
public Statement visitNonLocalReturnNode_(final NonLocalReturnNode _anObject) {
Statement _value;
_value = ((Statement) this.visit_(_anObject.value()));
if (_value.isNonLocalReturnNode()) {
return _value;
}
if (_value.isReturnNode()) {
_value = _value.returnValue();
}
if ((_localNlrMarker != null) && st.gravel.support.jvm.StringExtensions.equals_(_localNlrMarker, _anObject.marker())) {
return ReturnNode.factory.value_(((Expression) _value));
}
return NonLocalReturnNode.factory.marker_value_(_anObject.marker(), ((Expression) _value));
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class InlineExpressionCollection method innerSourceOn_.
@Override
public InlineExpressionCollection innerSourceOn_(final StringBuilder _aStream) {
_aStream.append("{");
boolean _temp1 = true;
for (final Expression _each : _expressions) {
if (_temp1) {
_temp1 = false;
} else {
_aStream.append(". ");
}
_each.innerSourceOn_(_aStream);
}
_aStream.append("]}");
return this;
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class IntermediateNodeRewriter method produce_or_.
public BooleanOrNode produce_or_(final Node _receiver, final Expression _testExpr) {
final BlockNode _testBlockNode;
if (!_testExpr.isBlockNode()) {
return null;
}
_testBlockNode = ((BlockNode) _testExpr);
return BooleanOrNode.factory.left_right_(((Expression) this.visit_(_receiver)), ((SequenceNode) this.visit_(_testBlockNode.body())));
}
Aggregations