Package tulip :: Package spec :: Module lexyacc :: Class Lexer
[frames] | no frames]

Class Lexer


Token rules to build LTL lexer.

Instance Methods
 
__init__(self, debug=False)
x.__init__(...) initializes x; see help(type(x)) for signature
 
t_NAME(self, t)
[A-Za-z_][A-za-z0-9._:]*
 
t_ALWAYS(self, t)
\[\]
 
t_EVENTUALLY(self, t)
\<\>
 
t_AND(self, t)
\&\&|\&
 
t_OR(self, t)
\|\||\|
 
t_comment(self, t)
\#.*
 
t_newline(self, t)
\n+
 
t_error(self, t)
 
build(self, debug=False, debuglog=None, **kwargs)
Create a lexer.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  reserved = {'F': 'EVENTUALLY', 'G': 'ALWAYS', 'U': 'UNTIL', 'V...
  values = {'next': 'X'}
  delimiters = ['LPAREN', 'RPAREN', 'DQUOTES', 'COMMA']
  operators = ['NOT', 'AND', 'OR', 'XOR', 'IMP', 'BIMP', 'EQUALS...
  misc = ['NAME', 'NUMBER']
  t_NOT = '\\!'
  t_XOR = '\\^'
  t_EQUALS = '\\='
  t_NEQUALS = '\\!\\='
  t_LT = '\\<'
  t_LE = '\\<\\='
  t_GT = '>\\='
  t_GE = '>'
  t_LPAREN = '\\('
  t_RPAREN = '\\)'
  t_NUMBER = '\\d+'
  t_IMP = '->'
  t_BIMP = '\\<->'
  t_PLUS = '\\+'
  t_MINUS = '-'
  t_TIMES = '\\*'
  t_DIV = '/'
  t_TRUNCATE = '<<>>'
  t_COMMA = ','
  t_DQUOTES = '\\"'
  t_PRIME = '\\\''
  t_ignore = ' \t'
Properties

Inherited from object: __class__

Method Details

__init__(self, debug=False)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

build(self, debug=False, debuglog=None, **kwargs)

 

Create a lexer.

Parameters:
  • kwargs - Same arguments as ply.lex.lex:
    • except for module (fixed to self)
    • debuglog defaults to the logger "ltl_lex_log".

Class Variable Details

reserved

Value:
{'F': 'EVENTUALLY',
 'G': 'ALWAYS',
 'U': 'UNTIL',
 'V': 'RELEASE',
 'W': 'WEAK_UNTIL',
 'X': 'NEXT',
 'false': 'FALSE',
 'ite': 'ITE',
...

operators

Value:
['NOT',
 'AND',
 'OR',
 'XOR',
 'IMP',
 'BIMP',
 'EQUALS',
 'NEQUALS',
...