use of st.gravel.support.compiler.ast.SequenceNode in project gravel by gravel-st.
the class Parser method parseKeywordMethod_.
public KeywordMethodNode parseKeywordMethod_(final String _aString) {
String _res;
final StringBuilder _str;
final List<VariableDeclarationNode> _arguments;
final SequenceNode _body;
final TypeNode _returnType;
final PragmaNode[][] _pragmas;
_pragmas = new PragmaNode[1][];
_str = st.gravel.support.jvm.WriteStreamFactory.on_(new String());
_str.append(_aString);
_str.append(':');
_arguments = new java.util.ArrayList();
this.eatWhitespace();
_arguments.add(this.parseVariableDeclaration());
this.eatWhitespace();
_res = this.parseKeywordIdentifier();
boolean _temp1 = false;
while (!_temp1) {
_temp1 = _res == null;
if (!_temp1) {
_str.append(_res);
Parser.this.eatWhitespace();
_arguments.add(Parser.this.parseVariableDeclaration());
Parser.this.eatWhitespace();
_res = Parser.this.parseKeywordIdentifier();
}
}
_returnType = this.parseReturnType();
_pragmas[0] = this.readPragmas();
_body = this.parseSequenceNode_(new st.gravel.support.jvm.Block1<Object, PragmaNode[]>() {
@Override
public Object value_(final PragmaNode[] _extraPragmas) {
return _pragmas[0] = st.gravel.support.jvm.ArrayExtensions.copyWithAll_(_pragmas[0], _extraPragmas);
}
});
return KeywordMethodNode.factory.selector_arguments_body_returnType_pragmas_protocol_(_str.toString(), _arguments.toArray(new VariableDeclarationNode[_arguments.size()]), _body, _returnType, _pragmas[0], null);
}
use of st.gravel.support.compiler.ast.SequenceNode in project gravel by gravel-st.
the class IntermediateNodeRewriter method produce$underscore$whileFalse_.
public WhileFalseNode produce$underscore$whileFalse_(final Expression _testExpr) {
final BlockNode _testBlockNode;
if (!_testExpr.isBlockNode()) {
return null;
}
_testBlockNode = ((BlockNode) _testExpr);
return WhileFalseNode.factory.testSequence_doSequence_(((SequenceNode) this.visit_(_testBlockNode.body())), null);
}
use of st.gravel.support.compiler.ast.SequenceNode 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.SequenceNode in project gravel by gravel-st.
the class IntermediateNodeRewriter method produce$underscore$whileTrue_.
public WhileTrueNode produce$underscore$whileTrue_(final Expression _testExpr) {
final BlockNode _testBlockNode;
if (!_testExpr.isBlockNode()) {
return null;
}
_testBlockNode = ((BlockNode) _testExpr);
return WhileTrueNode.factory.testSequence_doSequence_(((SequenceNode) this.visit_(_testBlockNode.body())), null);
}
Aggregations