integer.py 文件源码

python
阅读 13 收藏 0 点赞 0 评论 0

项目:Algebra-Computacional-UCM 作者: hhassan1 项目源码 文件源码
def __init__(self):
        super(GenericIntegerLexer, self).__init__()
        self.tokens = (
            'NUMBER',
            'PLUS',
            'MINUS',
            'TIMES',
            'DIVIDE',
            'POWER',
            'LPAREN',
            'RPAREN',
            'SCALAR',
            )
        self.t_NUMBER = r'\d+'
        self.t_PLUS   = r'\+'
        self.t_MINUS  = r'-'
        self.t_TIMES  = r'\*'
        self.t_DIVIDE  = r'/'
        self.t_POWER  = r'\^'
        self.t_LPAREN = r'\('
        self.t_RPAREN = r'\)'
        self.t_ignore = " \t"
        self.lexer = lex.lex(object=self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号