use of st.gravel.support.compiler.ast.TypeNode in project gravel by gravel-st.
the class GenericTypeVariableNode method innerSourceOn_.
@Override
public GenericTypeVariableNode innerSourceOn_(final StringBuilder _aStream) {
_root.sourceOn_(_aStream);
_aStream.append('[');
boolean _temp1 = true;
for (final TypeNode _arg : _arguments) {
if (_temp1) {
_temp1 = false;
} else {
_aStream.append(", ");
}
_arg.sourceOn_(_aStream);
}
_aStream.append(']');
return this;
}
use of st.gravel.support.compiler.ast.TypeNode in project gravel by gravel-st.
the class BlockTypeNode method innerSourceOn_.
@Override
public BlockTypeNode innerSourceOn_(final StringBuilder _aStream) {
_aStream.append('[');
boolean _temp1 = true;
for (final TypeNode _arg : _arguments) {
if (_temp1) {
_temp1 = false;
} else {
_aStream.append(", ");
}
_arg.sourceOn_(_aStream);
}
if (_returnType != null) {
if (_arguments.length != 0) {
_aStream.append(", ");
}
_aStream.append('^');
_returnType.sourceOn_(_aStream);
}
_aStream.append(']');
return this;
}
use of st.gravel.support.compiler.ast.TypeNode in project gravel by gravel-st.
the class Parser method parseTypeExpressionBlockAndClose.
public BlockTypeNode parseTypeExpressionBlockAndClose() {
TypeNode[] _args;
TypeNode _returnType;
_args = new TypeNode[] {};
_returnType = null;
boolean _temp1 = true;
while (_temp1) {
Parser.this.eatWhitespace();
if (st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, '^')) {
_returnType = Parser.this.parseTypeNode();
} else {
_args = st.gravel.support.jvm.ArrayExtensions.copyWith_(_args, Parser.this.parseTypeNode());
}
Parser.this.eatWhitespace();
_temp1 = st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ',');
}
st.gravel.support.jvm.ObjectExtensions.assert_(this, st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ']'));
return BlockTypeNode.factory.arguments_returnType_(_args, _returnType);
}
use of st.gravel.support.compiler.ast.TypeNode in project gravel by gravel-st.
the class Parser method parseTypeExpressionAndClose.
public TypeNode parseTypeExpressionAndClose() {
final TypeNode _exp;
_exp = this.parseTypeNode();
st.gravel.support.jvm.ObjectExtensions.assert_(this, st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, '}'));
return _exp;
}
use of st.gravel.support.compiler.ast.TypeNode in project gravel by gravel-st.
the class Parser method parseVariableDeclaration.
public VariableDeclarationNode parseVariableDeclaration() {
final String _varName;
TypeNode _type;
int _wsWidth;
final int _start;
_start = st.gravel.support.jvm.ReadStreamExtensions.position(_stream);
_varName = this.parseIdentifier();
this.eatWhitespace();
_type = null;
if (st.gravel.support.jvm.CharacterExtensions.equals_(st.gravel.support.jvm.ReadStreamExtensions.peek(_stream), '{')) {
st.gravel.support.jvm.ReadStreamExtensions.next(_stream);
_wsWidth = Parser.this.eatWhitespace();
if (st.gravel.support.jvm.CharacterExtensions.equals_(st.gravel.support.jvm.ReadStreamExtensions.peek(_stream), '^')) {
st.gravel.support.jvm.ReadStreamExtensions.skip_(_stream, (-1 - _wsWidth));
} else {
_type = Parser.this.parseTypeExpressionAndClose();
}
}
return ((VariableDeclarationNode) this.setSourcePosition_node_(_start, VariableDeclarationNode.factory.name_type_(_varName, _type)));
}
Aggregations