How to use the ply.lex.TOKEN function in ply

To help you get started, we’ve selected a few ply examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github salspaugh / splparser / splparser / lexers / lookuplexer.py View on Github external
@TOKEN(float)
def t_FLOAT(t):
    t.lexer.begin('ipunchecked')
    return t
github salspaugh / splparser / splparser / lexers / fieldformatlexer.py View on Github external
@TOKEN(modulus)
def t_MODULUS(t):
    t.lexer.begin('ipunchecked')
    return t
github salspaugh / splparser / splparser / lexers / fieldformatlexer.py View on Github external
@TOKEN(nbstr)
def t_NBSTR(t): # non-breaking string
    t.type = type_if_reserved(t, 'NBSTR')
    t.lexer.begin('ipunchecked')
    return t
github salspaugh / splparser / splparser / lexers / loadjoblexer.py View on Github external
@TOKEN(path)
def t_PATH(t):
    t.type = type_if_reserved(t, 'PATH')
    t.lexer.begin('ipunchecked')
    return(t)
github salspaugh / splparser / splparser / cmdparsers / renamelexer.py View on Github external
@TOKEN(nbstr)
def t_NBSTR(t): # non-breaking string
    t.type = type_if_reserved(t, 'NBSTR')
    t.lexer.begin('ipunchecked')
    return t
github salspaugh / splparser / splparser / lexers / convertlexer.py View on Github external
@TOKEN(path)
def t_PATH(t):
    t.type = type_if_reserved(t, 'PATH')
    t.lexer.begin('ipunchecked')
    return(t)
github salspaugh / splparser / splparser / lexers / convertlexer.py View on Github external
@TOKEN(url)
def t_URL(t):
    t.type = type_if_reserved(t, 'URL')
    t.lexer.begin('ipunchecked')
    return(t)
github salspaugh / splparser / splparser / cmdparsers / timechartlexer.py View on Github external
@TOKEN(common_fn)
def t_COMMON_FN(t):
    t.lexer.begin('ipunchecked')
    return(t)