Package uk.co.badgersinfoil.metaas.impl.antlr

Examples of uk.co.badgersinfoil.metaas.impl.antlr.LinkedListToken


    insertAfter(target, targetNext,
                child.getStartToken(), child.getStopToken());
  }

  public void appendToken(LinkedListTree parent, LinkedListToken append) {
    LinkedListToken insert = findClose(parent).getPrev();
    insertAfter(insert, insert.getNext(),
                append, append);
  }
View Full Code Here


    insertAfter(insert, insert.getNext(),
                append, append);
  }

  public void addToken(LinkedListTree parent, int index, LinkedListToken append) {
    LinkedListToken target;
    LinkedListToken targetNext;
    if (index == 0) {
      target = findOpen(parent);
      targetNext = target.getNext();
    } else {
      LinkedListTree beforeChild = (LinkedListTree)parent.getChild(index);
      targetNext = beforeChild.getStartToken();
      target = targetNext.getPrev();
    }
    insertAfter(target, targetNext,
                append, append);
  }
View Full Code Here

    insertAfter(target, targetNext,
                append, append);
  }

  public void deletedChild(LinkedListTree parent, int index, LinkedListTree child) {
    LinkedListToken start = child.getStartToken();
    LinkedListToken stop = child.getStopToken();
    LinkedListToken startPrev = start.getPrev();
    LinkedListToken stopNext = stop.getNext();
    if (startPrev != null) {
      startPrev.setNext(stopNext);
    } else if (stopNext != null) {
      stopNext.setPrev(startPrev);
    }
    // just to save possible confusion, break links out from the
    // removed token list too,
    start.setPrev(null);
    stop.setNext(null);
View Full Code Here

  public void setConst(boolean isConst) {
    if (isConst() == isConst) {
      return;
    }
    LinkedListToken node;
    if (isConst) {
      node = TokenBuilder.newConst();
    } else {
      node = TokenBuilder.newVar();
    }
View Full Code Here

    LinkedListTree superIdent = AS3FragmentParser.parseIdent(superclassName);
    if (ext == null) {
      ext = ASTUtils.newAST(AS3Parser.EXTENDS, "extends");
      ext.appendToken(TokenBuilder.newSpace());
      // hack a space in at the right point,
      LinkedListToken sp = TokenBuilder.newSpace();
      ext.getStartToken().beforeInsert(sp);
      ext.setStartToken(sp);
      ast.addChildWithTokens(EXTENDS_INDEX, ext);
      ext.addChildWithTokens(superIdent);
      ext.appendToken(TokenBuilder.newSpace());
View Full Code Here

    if (impls == null) {
      ASTIterator i = new ASTIterator(ast);
      i.find(AS3Parser.TYPE_BLOCK);
      impls = ASTUtils.newAST(AS3Parser.IMPLEMENTS, "implements");
      i.insertBeforeCurrent(impls);
      LinkedListToken sp = TokenBuilder.newSpace();
      impls.getStartToken().beforeInsert(sp);
    } else {
      impls.appendToken(TokenBuilder.newComma());
    }
    impls.appendToken(TokenBuilder.newSpace());
View Full Code Here

  /**
   * Stores modifications to the javadoc comment's AST back into the
   * comment token in the containing ActionScript AST.
   */
  public void commitModifiedAST() {
    LinkedListToken doc = DocCommentUtils.findDocCommentToken(ast);
    doc.setText("/**"+ASTUtils.stringifyNode(javadoc)+"*/");
  }
 
View Full Code Here

  private static final Map OPERATORS_BY_TYPE = new HashMap();
  private static final Map TYPES_BY_OPERATOR = new HashMap();

  private static void mapOp(int type, String text, ASBinaryExpression.Op operator) {
    OPERATORS_BY_TYPE.put(new Integer(type), operator);
    TYPES_BY_OPERATOR.put(operator, new LinkedListToken(type, text));
  }
View Full Code Here

    }
    return op;
  }

  public static void initialiseFromOp(ASBinaryExpression.Op operator, Token tok) {
    LinkedListToken type = (LinkedListToken)TYPES_BY_OPERATOR.get(operator);
    if (type == null) {
      throw new IllegalArgumentException("No operator for Op "+operator);
    }
    tok.setType(type.getType());
    tok.setText(type.getText());
  }
View Full Code Here

  private static final Map OPERATORS_BY_TYPE = new HashMap();
  private static final Map TYPES_BY_OPERATOR = new HashMap();

  private static void mapOp(int type, String text, ASAssignmentExpression.Op operator) {
    OPERATORS_BY_TYPE.put(new Integer(type), operator);
    TYPES_BY_OPERATOR.put(operator, new LinkedListToken(type, text));
  }
View Full Code Here

TOP

Related Classes of uk.co.badgersinfoil.metaas.impl.antlr.LinkedListToken

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.