Java Code Examples for jdk.nashorn.internal.parser.Token#recast()

The following examples show how to use jdk.nashorn.internal.parser.Token#recast() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LiteralNode.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 *
 * @param token   token
 * @param finish  finish
 * @param value   array literal value, a Node array
 */
protected ArrayLiteralNode(final long token, final int finish, final Expression[] value) {
    super(Token.recast(token, TokenType.ARRAY), finish, value);
    this.elementType = Type.UNKNOWN;
    this.presets     = null;
    this.postsets    = null;
    this.units       = null;
}
 
Example 2
Source File: SplitIntoFunctions.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static IfNode makeIfStateEquals(final int lineNumber, final long token, final int finish,
        final int value, final Block pass, final Statement fail) {
    return new IfNode(lineNumber, token, finish,
            new BinaryNode(Token.recast(token, TokenType.EQ_STRICT),
                    GetSplitState.INSTANCE, intLiteral(value)),
            pass,
            fail == null ? null : new Block(NO_TOKEN, NO_FINISH, fail));
}
 
Example 3
Source File: SplitIntoFunctions.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static IfNode makeIfStateEquals(final int lineNumber, final long token, final int finish,
        final int value, final Block pass, final Statement fail) {
    return new IfNode(lineNumber, token, finish,
            new BinaryNode(Token.recast(token, TokenType.EQ_STRICT),
                    GetSplitState.INSTANCE, intLiteral(value)),
            pass,
            fail == null ? null : new Block(NO_TOKEN, NO_FINISH, fail));
}
 
Example 4
Source File: LiteralNode.java    From jdk8u_nashorn with GNU General Public License v2.0 4 votes vote down vote up
private NullLiteralNode(final long token, final int finish) {
    super(Token.recast(token, TokenType.OBJECT), finish, null);
}
 
Example 5
Source File: LiteralNode.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private BooleanLiteralNode(final long token, final int finish, final boolean value) {
    super(Token.recast(token, value ? TokenType.TRUE : TokenType.FALSE), finish, value);
}
 
Example 6
Source File: LiteralNode.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private BooleanLiteralNode(final long token, final int finish, final boolean value) {
    super(Token.recast(token, value ? TokenType.TRUE : TokenType.FALSE), finish, value);
}
 
Example 7
Source File: LiteralNode.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private LexerTokenLiteralNode(final long token, final int finish, final LexerToken value) {
    super(Token.recast(token, TokenType.STRING), finish, value); //TODO is string the correct token type here?
}
 
Example 8
Source File: LiteralNode.java    From nashorn with GNU General Public License v2.0 4 votes vote down vote up
private NullLiteralNode(final long token, final int finish) {
    super(Token.recast(token, TokenType.OBJECT), finish, null);
}
 
Example 9
Source File: LiteralNode.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private NullLiteralNode(final long token, final int finish) {
    super(Token.recast(token, TokenType.OBJECT), finish, null);
}
 
Example 10
Source File: LiteralNode.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private StringLiteralNode(final long token, final int finish, final String value) {
    super(Token.recast(token, TokenType.STRING), finish, value);
}
 
Example 11
Source File: LiteralNode.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private StringLiteralNode(final long token, final int finish, final String value) {
    super(Token.recast(token, TokenType.STRING), finish, value);
}
 
Example 12
Source File: LiteralNode.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private NumberLiteralNode(final long token, final int finish, final Number value) {
    super(Token.recast(token, TokenType.DECIMAL), finish, value);
}
 
Example 13
Source File: LiteralNode.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private LexerTokenLiteralNode(final long token, final int finish, final LexerToken value) {
    super(Token.recast(token, TokenType.STRING), finish, value); //TODO is string the correct token type here?
}
 
Example 14
Source File: LiteralNode.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private LexerTokenLiteralNode(final long token, final int finish, final LexerToken value) {
    super(Token.recast(token, TokenType.STRING), finish, value); //TODO is string the correct token type here?
}
 
Example 15
Source File: LiteralNode.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private BooleanLiteralNode(final long token, final int finish, final boolean value) {
    super(Token.recast(token, value ? TokenType.TRUE : TokenType.FALSE), finish, value);
}
 
Example 16
Source File: LiteralNode.java    From nashorn with GNU General Public License v2.0 4 votes vote down vote up
private NumberLiteralNode(final long token, final int finish, final Number value) {
    super(Token.recast(token, TokenType.DECIMAL), finish, value);
}
 
Example 17
Source File: LiteralNode.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private UndefinedLiteralNode(final long token, final int finish) {
    super(Token.recast(token, TokenType.OBJECT), finish, ScriptRuntime.UNDEFINED);
}
 
Example 18
Source File: LiteralNode.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private UndefinedLiteralNode(final long token, final int finish) {
    super(Token.recast(token, TokenType.OBJECT), finish, ScriptRuntime.UNDEFINED);
}
 
Example 19
Source File: LiteralNode.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private UndefinedLiteralNode(final long token, final int finish) {
    super(Token.recast(token, TokenType.OBJECT), finish, ScriptRuntime.UNDEFINED);
}
 
Example 20
Source File: LiteralNode.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor
 *
 * @param token   token
 * @param finish  finish
 * @param value   array literal value, a Node array
 */
protected ArrayLiteralNode(final long token, final int finish, final Expression[] value) {
    super(Token.recast(token, TokenType.ARRAY), finish, value);
    this.elementType = Type.UNKNOWN;
}