use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class Parser method parseMessageChain_.
public Expression parseMessageChain_(final Expression _receiver) {
final Expression _exp;
List<MessageNode> _messages;
_exp = this.parseNoCascadeMessageChain_(_receiver);
this.eatWhitespace();
if (st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ';')) {
final MessageNode _baseMsg;
_messages = new java.util.ArrayList();
_baseMsg = ((MessageNode) _exp);
_messages.add(_baseMsg);
boolean _temp1 = true;
while (_temp1) {
final MessageNode _msg;
_msg = ((MessageNode) Parser.this.parseNoCascadeMessageChain_(_baseMsg.receiver()));
_messages.add(_msg);
_temp1 = st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ';');
}
return CascadeNode.factory.messages_(_messages.toArray(new MessageNode[_messages.size()]));
}
return _exp;
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class Parser method parseAssignmentOrExpression.
public Expression parseAssignmentOrExpression() {
final Expression _rec;
final int _start;
_start = st.gravel.support.jvm.ReadStreamExtensions.position(_stream);
_rec = this.parseExpression();
this.eatWhitespace();
if (st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ':')) {
st.gravel.support.jvm.ObjectExtensions.assert_(Parser.this, st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, '='));
return ((Expression) Parser.this.setSourcePosition_node_(_start, Parser.this.parseAssignment_(_rec)));
}
return ((Expression) this.setSourcePosition_node_(_start, _rec));
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class Parser method parseNestedExpression.
public Expression parseNestedExpression() {
Expression _exp;
final int _start;
final TypeNode _typeCast;
_start = st.gravel.support.jvm.ReadStreamExtensions.position(_stream);
st.gravel.support.jvm.ReadStreamExtensions.next(_stream);
this.eatWhitespace();
_typeCast = st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, '{') ? this.parseTypeExpressionAndClose() : null;
_exp = this.parseAssignmentOrExpression();
if (_typeCast != null) {
_exp = TypeCast.factory.type_expression_(_typeCast, _exp);
}
this.eatWhitespace();
st.gravel.support.jvm.ObjectExtensions.assert_(this, st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ')'));
return ((Expression) this.setSourcePosition_node_(_start, _exp));
}
use of st.gravel.support.compiler.ast.Expression in project gravel by gravel-st.
the class Parser method parseKeywordMessageChain_receiver_.
public Expression parseKeywordMessageChain_receiver_(final String _aString, final Expression _receiver) {
String _res;
final StringBuilder _str;
final List<Expression> _arguments;
_str = st.gravel.support.jvm.WriteStreamFactory.on_(new String());
_str.append(_aString);
_str.append(':');
_arguments = new java.util.ArrayList();
this.eatWhitespace();
_arguments.add(this.parseBinaryOrUnaryMessage());
this.eatWhitespace();
_res = this.parseIdentifier();
boolean _temp1 = false;
while (!_temp1) {
_temp1 = _res == null;
if (!_temp1) {
st.gravel.support.jvm.ObjectExtensions.assert_(Parser.this, st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ':'));
_str.append(_res);
_str.append(':');
Parser.this.eatWhitespace();
_arguments.add(Parser.this.parseBinaryOrUnaryMessage());
Parser.this.eatWhitespace();
_res = Parser.this.parseIdentifier();
}
}
return KeywordMessageNode.factory.receiver_selector_arguments_(_receiver, _str.toString(), _arguments.toArray(new Expression[_arguments.size()]));
}
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);
}
Aggregations