ehn.parse.parser module

Please refer the tutorial “Parser”.

exception ehn.parse.parser.EhnSyntaxError(*args, pos=None)[source]

Bases: SyntaxError

E-HowNet Syntax Error.

show_pos(text)[source]

Show error position.

Parameters

text – original input text

class ehn.parse.parser.EhnLexer(**kwargs)[source]

Bases: ehn.parse.parser._EhnLexer

E-HowNet Lexer.

__call__(self, data)

Run tokenization.

class ehn.parse.parser.EhnParser(lexer=None, **kwargs)[source]

Bases: ehn.parse.parser._EhnParser

E-HowNet Parser.

__call__(self, data: str)

Run parsing.