@Override public void firstPathTokenWeakKeywords() throws TokenStreamException { int t = LA( 1 ); switch ( t ){ case DOT: LT(0).setType( IDENT ); } }
@Override public void handleDotIdent() throws TokenStreamException { // This handles HHH-354, where there is a strange property name in a where clause. // If the lookahead contains a DOT then something that isn't an IDENT... if ( LA( 1 ) == DOT && LA( 2 ) != IDENT ) { // See if the second lookahead token can be an identifier. HqlToken t = (HqlToken) LT( 2 ); if ( t.isPossibleID() ) { // Set it! LT( 2 ).setType( IDENT ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "handleDotIdent() : new LT(2) token - %s", LT( 1 ) ); } } } }
token.setType( HqlTokenTypes.WEIRD_IDENT ); astFactory.addASTChild( currentAST, astFactory.create( token ) ); consume();
@Override public void weakKeywords() throws TokenStreamException { int t = LA( 1 ); switch ( t ) { case ORDER: case GROUP: // Case 1: Multi token keywords GROUP BY and ORDER BY // The next token ( LT(2) ) should be 'by'... otherwise, this is just an ident. if ( LA( 2 ) != LITERAL_by ) { LT( 1 ).setType( IDENT ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "weakKeywords() : new LT(1) token - %s", LT( 1 ) ); } } break; default: // Case 2: The current token is after FROM and before '.'. if ( LA( 0 ) == FROM && t != IDENT && LA( 2 ) == DOT ) { HqlToken hqlToken = (HqlToken) LT( 1 ); if ( hqlToken.isPossibleID() ) { hqlToken.setType( IDENT ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "weakKeywords() : new LT(1) token - %s", LT( 1 ) ); } } } break; } }
_returnToken.setType(_ttype); return _returnToken;
_ttype = _returnToken.getType(); _ttype = testLiteralsTable(_ttype); _returnToken.setType(_ttype); return _returnToken;
_returnToken.setType(_ttype); return _returnToken;
_ttype = _returnToken.getType(); _ttype = testLiteralsTable(_ttype); _returnToken.setType(_ttype); return _returnToken;
_ttype = _returnToken.getType(); _ttype = testLiteralsTable(_ttype); _returnToken.setType(_ttype); return _returnToken;
_returnToken.setType(_ttype); return _returnToken;
public void setType(int type) { token.setType(type); }
public void setType(int type) { token.setType(type); }
_returnToken.setType(_ttype); return _returnToken;
_returnToken.setType(_ttype); return _returnToken;
public void weakKeywords() throws TokenStreamException { int t = LA( 1 ); switch ( t ) { case ORDER: case GROUP: // The next token ( LT(2) ) should be 'by'... otherwise, this is just an ident. if ( LA( 2 ) != LITERAL_by ) { LT( 1 ).setType( IDENT ); if ( log.isDebugEnabled() ) { log.debug( "weakKeywords() : new LT(1) token - " + LT( 1 ) ); } } break; default: break; } }
protected Token makeToken(int t) { try { Token tok = (Token)tokenObjectClass.newInstance(); tok.setType(t); tok.setColumn(inputState.tokenStartColumn); tok.setLine(inputState.tokenStartLine); // tracking real start line now: tok.setLine(inputState.line); return tok; } catch (InstantiationException ie) { panic("can't instantiate token: " + tokenObjectClass); } catch (IllegalAccessException iae) { panic("Token class is not accessible" + tokenObjectClass); } return Token.badToken; }
public void handleDotIdent() throws TokenStreamException { // This handles HHH-354, where there is a strange property name in a where clause. // If the lookahead contains a DOT then something that isn't an IDENT... if (LA(1) == DOT && LA(2) != IDENT) { // See if the second lookahed token can be an identifier. HqlToken t = (HqlToken)LT(2); if (t.isPossibleID()) { // Set it! LT( 2 ).setType( IDENT ); if ( log.isDebugEnabled() ) { log.debug( "handleDotIdent() : new LT(2) token - " + LT( 1 ) ); } } } }
public void weakKeywords() throws TokenStreamException { int t = LA( 1 ); switch ( t ) { case ORDER: case GROUP: // Case 1: Multi token keywords GROUP BY and ORDER BY // The next token ( LT(2) ) should be 'by'... otherwise, this is just an ident. if ( LA( 2 ) != LITERAL_by ) { LT( 1 ).setType( IDENT ); if ( log.isDebugEnabled() ) { log.debug( "weakKeywords() : new LT(1) token - " + LT( 1 ) ); } } break; default: // Case 2: The current token is after FROM and before '.'. if (LA(0) == FROM && t != IDENT && LA(2) == DOT) { HqlToken hqlToken = (HqlToken)LT(1); if (hqlToken.isPossibleID()) { hqlToken.setType(IDENT); if ( log.isDebugEnabled() ) { log.debug( "weakKeywords() : new LT(1) token - " + LT( 1 ) ); } } } break; } }
@Override public void handleDotIdent() throws TokenStreamException { // This handles HHH-354, where there is a strange property name in a where clause. // If the lookahead contains a DOT then something that isn't an IDENT... if ( LA( 1 ) == DOT && LA( 2 ) != IDENT ) { // See if the second lookahead token can be an identifier. HqlToken t = (HqlToken) LT( 2 ); if ( t.isPossibleID() ) { // Set it! LT( 2 ).setType( IDENT ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "handleDotIdent() : new LT(2) token - %s", LT( 1 ) ); } } } }
@Override public void handleDotIdent() throws TokenStreamException { // This handles HHH-354, where there is a strange property name in a where clause. // If the lookahead contains a DOT then something that isn't an IDENT... if ( LA( 1 ) == DOT && LA( 2 ) != IDENT ) { // See if the second lookahead token can be an identifier. HqlToken t = (HqlToken) LT( 2 ); if ( t.isPossibleID() ) { // Set it! LT( 2 ).setType( IDENT ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "handleDotIdent() : new LT(2) token - %s", LT( 1 ) ); } } } }