use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class SequenceNode method methodSourceOn_.
public SequenceNode methodSourceOn_(final StringBuilder _aStream) {
this.sourceTemporariesOn_(_aStream);
boolean _temp1 = true;
for (final Statement _stmt : _statements) {
if (_temp1) {
_temp1 = false;
} else {
_aStream.append('.');
}
_aStream.append('\n');
_aStream.append('\t');
_stmt.innerSourceOn_(_aStream);
}
return this;
}
use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class SequenceNode method sourceOn_.
@Override
public SequenceNode sourceOn_(final StringBuilder _aStream) {
this.sourceTemporariesOn_(_aStream);
if ((_temporaries.length != 0) && (_statements.length != 0)) {
_aStream.append('\n');
}
boolean _temp1 = true;
for (final Statement _stmt : _statements) {
if (_temp1) {
_temp1 = false;
} else {
_aStream.append('.');
_aStream.append('\n');
}
_aStream.append(' ');
_stmt.innerSourceOn_(_aStream);
}
return this;
}
use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class SourcePrinter method printStatements_indent_.
public SourcePrinter printStatements_indent_(final Statement[] _stmts, final boolean _aBoolean) {
final int _show;
Statement _thisStatement;
boolean _indent;
_indent = _aBoolean;
_show = _stmts.length;
for (int _i = 1; _i <= _show; _i++) {
_thisStatement = _stmts[_i - 1];
if ((_thisStatement.comment().length > 0)) {
if (st.gravel.support.jvm.IntegerExtensions.equals_(_i, 1)) {
SourcePrinter.this.crtab_(_indentation);
}
_stream.append('\t');
}
if (_indent) {
SourcePrinter.this.crtab_(_indentation);
}
SourcePrinter.this.visit_(_thisStatement);
if ((_i < _show)) {
_stream.append('.');
}
_indent = true;
}
return this;
}
use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class MessageSendRewriter method visitKeywordMessageNode_.
@Override
public Statement visitKeywordMessageNode_(final KeywordMessageNode _anObject) {
final st.gravel.core.Symbol _selector;
final st.gravel.support.jvm.Block1<Statement, MessageNode> _res;
_selector = st.gravel.core.Symbol.value(_anObject.selector());
st.gravel.support.jvm.Block1<Statement, MessageNode> _temp1 = _specialSelectors.get(_selector);
_res = ((st.gravel.support.jvm.Block1<Statement, MessageNode>) _temp1);
if (_res != null) {
final Statement _trans;
_trans = _res.value_(_anObject);
if (_trans != null) {
return _trans;
}
}
return super.visitKeywordMessageNode_(_anObject);
}
use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class Parser method parseSequenceNode_.
public SequenceNode parseSequenceNode_(final st.gravel.support.jvm.Block1<Object, PragmaNode[]> _extraPragmaBlock) {
VariableDeclarationNode[] _temporaries;
Statement[] _statements;
Statement _statement;
final int _start;
final PragmaNode[] _pragmas;
_start = st.gravel.support.jvm.ReadStreamExtensions.position(_stream);
this.eatWhitespace();
_temporaries = new VariableDeclarationNode[] {};
if (st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, '|')) {
Parser.this.eatWhitespace();
boolean _temp1 = false;
while (!_temp1) {
_temp1 = st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, '|');
if (!_temp1) {
Parser.this.eatWhitespace();
_temporaries = st.gravel.support.jvm.ArrayExtensions.copyWith_(_temporaries, Parser.this.parseVariableDeclaration());
Parser.this.eatWhitespace();
}
}
}
_pragmas = this.readPragmas();
if (_pragmas.length != 0) {
_extraPragmaBlock.value_(_pragmas);
}
_statements = new Statement[] {};
_statement = this.parseStatement();
this.eatWhitespace();
boolean _temp2 = false;
while (!_temp2) {
_temp2 = _statement == null;
if (!_temp2) {
_statements = st.gravel.support.jvm.ArrayExtensions.copyWith_(_statements, _statement);
st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, '.');
_statement = Parser.this.parseStatement();
Parser.this.eatWhitespace();
}
}
return ((SequenceNode) this.setSourcePosition_node_(_start, SequenceNode.factory.temporaries_statements_(_temporaries, _statements)));
}
Aggregations