/** * Creates a token that represents an integer. */ public static Token newInteger( String text, int startLine, int startColumn ) { return new Token( Types.INTEGER_NUMBER, text, startLine, startColumn ); }
public CompareToNullExpression(final Expression objectExpression, final boolean compareToNull) { super(objectExpression, new Token(Types.COMPARE_TO, compareToNull ? "==" : "!=", -1, -1), ConstantExpression.NULL); this.objectExpression = objectExpression; this.equalsNull = compareToNull; }
/** * Creates a token that represents an identifier. */ public static Token newIdentifier( String text, int startLine, int startColumn ) { return new Token( Types.IDENTIFIER, text, startLine, startColumn ); }
public CompareIdentityExpression(final Expression leftExpression, final Expression rightExpression) { super(leftExpression, new Token(Types.COMPARE_TO, "==", -1, -1), rightExpression); this.leftExpression = leftExpression; this.rightExpression = rightExpression; }
/** * Creates a token that represents a double-quoted string. */ public static Token newString( String text, int startLine, int startColumn ) { return new Token( Types.STRING, text, startLine, startColumn ); }
/** * Creates a token that represents a decimal number. */ public static Token newDecimal( String text, int startLine, int startColumn ) { return new Token( Types.DECIMAL_NUMBER, text, startLine, startColumn ); }
/** * Returns a copy of this Token. */ public Token dup() { Token token = new Token( this.type, this.text, this.startLine, this.startColumn ); token.setMeaning( this.meaning ); return token; }
/** * Creates a token that represents a symbol, using a library for the type. */ public static Token newSymbol( String type, int startLine, int startColumn ) { return new Token( Types.lookupSymbol(type), type, startLine, startColumn ); }
/** * Creates a token with the specified meaning. */ public static Token newPlaceholder( int type ) { Token token = new Token( Types.UNKNOWN, "", -1, -1 ); token.setMeaning( type ); return token; }
/** * Creates a token that represents a symbol, using a library for the text. */ public static Token newSymbol( int type, int startLine, int startColumn ) { return new Token( type, Types.getText(type), startLine, startColumn ); }
/** * Creates a token that represents a keyword. Returns null if the * specified text isn't a keyword. */ public static Token newKeyword( String text, int startLine, int startColumn ) { int type = Types.lookupKeyword( text ); if( type != Types.UNKNOWN ) { return new Token( type, text, startLine, startColumn ); } return null; }
private Token getOpWithoutEqual(Expression exp) { if (!(exp instanceof BinaryExpression)) return null; // should never happen Token op = ((BinaryExpression) exp).getOperation(); int typeWithoutEqual = TokenUtil.removeAssignment(op.getType()); return new Token(typeWithoutEqual, op.getText() /* will do */, op.getStartLine(), op.getStartColumn()); }
/** * Creates a token that represents a decimal number. */ public static Token newDecimal( String text, int startLine, int startColumn ) { return new Token( Types.DECIMAL_NUMBER, text, startLine, startColumn ); }
/** * Creates a token that represents a double-quoted string. */ public static Token newString( String text, int startLine, int startColumn ) { return new Token( Types.STRING, text, startLine, startColumn ); }
/** * Creates a token that represents a symbol, using a library for the type. */ public static Token newSymbol( String type, int startLine, int startColumn ) { return new Token( Types.lookupSymbol(type), type, startLine, startColumn ); }
/** * Creates a token that represents a symbol, using a library for the type. */ public static Token newSymbol( String type, int startLine, int startColumn ) { return new Token( Types.lookupSymbol(type), type, startLine, startColumn ); }
/** * Creates a token with the specified meaning. */ public static Token newPlaceholder( int type ) { Token token = new Token( Types.UNKNOWN, "", -1, -1 ); token.setMeaning( type ); return token; }
/** * Creates a token that represents a symbol, using a library for the type. */ public static Token newSymbol( String type, int startLine, int startColumn ) { return new Token( Types.lookupSymbol(type), type, startLine, startColumn ); }
/** * Returns a copy of this Token. */ public Token dup() { Token token = new Token( this.type, this.text, this.startLine, this.startColumn ); token.setMeaning( this.meaning ); return token; }
/** * Creates a token with the specified meaning. */ public static Token newPlaceholder( int type ) { Token token = new Token( Types.UNKNOWN, "", -1, -1 ); token.setMeaning( type ); return token; }