示例#1
0
  public void defaultCase(Node node) {
    if (node instanceof TQuotedName
        || node instanceof TFullIdentifier
        || node instanceof TIdentifier
        || node instanceof TStringConstant
        || node instanceof TIntegerConstant
        || node instanceof TFloatConstant
        || node instanceof TAtIdentifier) {

      if (debug) G.v().out.println("Default case -pushing token:" + ((Token) node).getText());
      String tokenString = ((Token) node).getText();
      if (node instanceof TStringConstant || node instanceof TQuotedName) {
        tokenString = tokenString.substring(1, tokenString.length() - 1);
      }

      if (node instanceof TIdentifier
          || node instanceof TFullIdentifier
          || node instanceof TQuotedName
          || node instanceof TStringConstant) {
        try {
          tokenString = StringTools.getUnEscapedStringOf(tokenString);

        } catch (RuntimeException e) {
          G.v().out.println(tokenString);
          throw e;
        }
      }

      mProductions.addLast(tokenString);
    }
  }
示例#2
0
 /*
   file =
   modifier* file_type class_name extends_clause? implements_clause? file_body;
 */
 public void inAFile(AFile node) {
   if (debug) G.v().out.println("reading class " + node.getClassName());
 }