Package st.gravel.support.compiler.ast

Examples of st.gravel.support.compiler.ast.VariableDeclarationNode


      JVMMethodCompiler.this.produceVarRead_("self");
      JVMMethodCompiler.this.ensureCast_(_staticSignature[0].arguments()[0]);
    }
    for (int _temp1 = 0; _temp1 < _aMethodNode.arguments().length; _temp1++) {
      final int _i = _temp1 + 1;
      final VariableDeclarationNode _each = _aMethodNode.arguments()[_temp1];
      JVMMethodCompiler.this.produceVarRead_(_each.name());
      JVMMethodCompiler.this.ensureCast_(_staticSignature[0].arguments()[(_i + (_selfOffset[0])) - 1]);
    }
    this.emit_(_invoke);
    if (_staticSignature[0].returnType().isVoidType()) {
      JVMMethodCompiler.this.produceVarRead_("self");
View Full Code Here


  public KeywordMethodNode sourceOn_(final StringBuilder _aStream) {
    final String[] _keywords;
    _keywords = st.gravel.support.jvm.StringExtensions.tokensBasedOn_(_selector, ':');
    for (int _i = 1; _i <= _arguments.length; _i++) {
      final String _keyword;
      final VariableDeclarationNode _argument;
      _keyword = _keywords[_i - 1];
      _argument = _arguments[_i - 1];
      if (!st.gravel.support.jvm.IntegerExtensions.equals_(_i, 1)) {
        _aStream.append(' ');
      }
      _aStream.append(_keyword);
      _aStream.append(':');
      _aStream.append(' ');
      _argument.sourceOn_(_aStream);
    }
    this.returnTypeAndBodySourceOn_(_aStream);
    return this;
  }
View Full Code Here

    return this.copy();
  }

  @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())));
  }
View Full Code Here

    return GlobalWriteNode.factory.namespace_name_value_(_namespace, _anObject.variable().name(), ((Expression) this.visit_(_anObject.value())));
  }

  @Override
  public Expression visitVariableNode_(final VariableNode _anObject) {
    final VariableDeclarationNode _instVar;
    if (st.gravel.support.jvm.StringExtensions.equals_(_anObject.name(), "self")) {
      return SelfNode.factory.basicNew();
    }
    if (st.gravel.support.jvm.StringExtensions.equals_(_anObject.name(), "super")) {
      return SuperNode.factory.reference_(_ownerReference);
    }
    if (this.includesLocalName_(_anObject.name())) {
      return LocalReadNode.factory.name_(_anObject.name());
    }
    _instVar = this.instVarAt_(_anObject.name());
    if (_instVar != null) {
      return FieldReadNode.factory.owner_field_type_(_owner, _instVar.name(), _instVar.type());
    }
    return GlobalReadNode.factory.namespace_name_(_namespace, _anObject.name());
  }
View Full Code Here

    }
    return _str.toString();
  }

  public BinaryMethodNode parseBinaryMethod_(final String _aString) {
    final VariableDeclarationNode _argument;
    final SequenceNode _body;
    final TypeNode _returnType;
    final PragmaNode[][] _pragmas;
    _pragmas = new PragmaNode[1][];
    this.eatWhitespace();
View Full Code Here

    _temporaries = new List[1];
    _oldExtraTemps = new List[1];
    _temporaries[0] = new java.util.ArrayList();
    _statements[0] = new java.util.ArrayList();
    for (final VariableDeclarationNode _each : _anObject.temporaries()) {
      final VariableDeclarationNode _newTemp;
      _newTemp = ((VariableDeclarationNode) LiteralSendInliner.this.visit_(_each));
      _temporaries[0].add(_newTemp);
    }
    for (final Statement _each : _anObject.statements()) {
      final Statement _res;
View Full Code Here

    })));
    _temporaries = st.gravel.support.jvm.ArrayExtensions.collect_(_anObject.temporaries(), ((st.gravel.support.jvm.Block1<VariableDeclarationNode, VariableDeclarationNode>) (new st.gravel.support.jvm.Block1<VariableDeclarationNode, VariableDeclarationNode>() {

      @Override
      public VariableDeclarationNode value_(final VariableDeclarationNode _each) {
        VariableDeclarationNode _newDecl;
        if (st.gravel.support.jvm.StringExtensions.equals_(_each.name(), _varName)) {
          _found[0].add(_each);
          _newDecl = HolderDeclarationNode.factory.name_type_(_each.name(), ((TypeNode) VariableToHolderRewriter.this.visit_(_each.type())));
        } else {
          _newDecl = ((VariableDeclarationNode) VariableToHolderRewriter.this.visit_(_each));
View Full Code Here

TOP

Related Classes of st.gravel.support.compiler.ast.VariableDeclarationNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.