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())));
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class Parser method parseBinaryMessageChain_receiver_.
public Expression parseBinaryMessageChain_receiver_(final String _aString, final Expression _rec) {
final Expression _arg;
final BinaryMessageNode _receiver;
this.eatWhitespace();
_arg = this.parseUnaryMessage();
this.eatWhitespace();
_receiver = BinaryMessageNode.factory.receiver_selector_argument_(_rec, _aString, _arg);
return this.parseBinaryOrUnaryMessage_(_receiver);
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class VariableAccessToFieldAccessConverter method visitAssignmentNode_.
@Override
public Expression visitAssignmentNode_(final AssignmentNode _anObject) {
final VariableDeclarationNode _instVar;
if (this.includesLocalName_(_anObject.variable().name())) {
return LocalWriteNode.factory.name_value_(_anObject.variable().name(), ((Expression) VariableAccessToFieldAccessConverter.this.visit_(_anObject.value())));
}
_instVar = this.instVarAt_(_anObject.variable().name());
if (_instVar != null) {
return FieldWriteNode.factory.owner_field_type_value_(_owner, _instVar.name(), _instVar.type(), ((Expression) VariableAccessToFieldAccessConverter.this.visit_(_anObject.value())));
}
return GlobalWriteNode.factory.namespace_name_value_(_namespace, _anObject.variable().name(), ((Expression) this.visit_(_anObject.value())));
}
Aggregations