- 3.0.1 core module.
|
Classes | |
class | CodeNode |
class | Cursor |
class | ElseNode |
class | Env |
class | ExpNode |
class | ForNode |
class | IfNode |
class | LiteralDollarNode |
class | Output |
class | RangeNode |
class | RawCodeNode |
class | Token |
class | VarNode |
Functions | |
def | Eof () |
def | StartsWith (lines, pos, string) |
def | FindFirstInLine (line, token_table) |
def | FindFirst (lines, token_table, cursor) |
def | SubString (lines, start, end) |
def | StripMetaComments (str) |
def | MakeToken (lines, start, end, token_type) |
def | ParseToken (lines, pos, regex, token_type) |
def | Skip (lines, pos, regex) |
def | SkipUntil (lines, pos, regex, token_type) |
def | ParseExpTokenInParens (lines, pos) |
def | RStripNewLineFromToken (token) |
def | TokenizeLines (lines, pos) |
def | Tokenize (s) |
def | PopFront (a_list) |
def | PushFront (a_list, elem) |
def | PopToken (a_list, token_type=None) |
def | PeekToken (a_list) |
def | ParseExpNode (token) |
def | ParseElseNode (tokens) |
def | ParseAtomicCodeNode (tokens) |
def | ParseCodeNode (tokens) |
def | ParseToAST (pump_src_text) |
def | RunAtomicCode (env, node, output) |
def | RunCode (env, code_node, output) |
def | IsSingleLineComment (cur_line) |
def | IsInPreprocessorDirective (prev_lines, cur_line) |
def | WrapComment (line, output) |
def | WrapCode (line, line_concat, output) |
def | WrapPreprocessorDirective (line, output) |
def | WrapPlainCode (line, output) |
def | IsMultiLineIWYUPragma (line) |
def | IsHeaderGuardIncludeOrOneLineIWYUPragma (line) |
def | WrapLongLine (line, output) |
def | BeautifyCode (string) |
def | ConvertFromPumpSource (src_text) |
def | main (argv) |
Variables | |
list | TOKEN_TABLE |
ID_REGEX = re.compile(r'[_A-Za-z]\w*') | |
EQ_REGEX = re.compile(r'=') | |
REST_OF_LINE_REGEX = re.compile(r'.*?(?=$|\$\$)') | |
OPTIONAL_WHITE_SPACES_REGEX = re.compile(r'\s*') | |
WHITE_SPACE_REGEX = re.compile(r'\s') | |
DOT_DOT_REGEX = re.compile(r'\.\.') | |
def pump.Eof | ( | ) |
Returns the special cursor to denote the end-of-file.
Referenced by pump.Cursor.__str__(), SubString(), and TokenizeLines().
def pump.StartsWith | ( | lines, | |
pos, | |||
string | |||
) |
Returns True iff the given position in lines starts with 'string'.
Referenced by GTEST_DISABLE_MSC_WARNINGS_PUSH_(), and TEST().
def pump.FindFirstInLine | ( | line, | |
token_table | |||
) |
Referenced by FindFirst().
def pump.FindFirst | ( | lines, | |
token_table, | |||
cursor | |||
) |
Finds the first occurrence of any string in strings in lines.
References FindFirstInLine(), and MakeToken().
Referenced by TokenizeLines().
def pump.SubString | ( | lines, | |
start, | |||
end | |||
) |
Returns a substring in lines.
References Eof().
Referenced by MakeToken(), ParseExpTokenInParens(), and TokenizeLines().
def pump.StripMetaComments | ( | str | ) |
Strip meta comments from each line in the given string.
Referenced by ConvertFromPumpSource().
def pump.MakeToken | ( | lines, | |
start, | |||
end, | |||
token_type | |||
) |
Creates a new instance of Token.
References SubString().
Referenced by FindFirst(), ParseExpTokenInParens(), ParseToken(), and TokenizeLines().
def pump.ParseToken | ( | lines, | |
pos, | |||
regex, | |||
token_type | |||
) |
References MakeToken().
Referenced by TokenizeLines().
def pump.Skip | ( | lines, | |
pos, | |||
regex | |||
) |
Referenced by ParseExpTokenInParens(), and TokenizeLines().
def pump.SkipUntil | ( | lines, | |
pos, | |||
regex, | |||
token_type | |||
) |
Referenced by ParseExpTokenInParens(), and TokenizeLines().
def pump.ParseExpTokenInParens | ( | lines, | |
pos | |||
) |
References MakeToken(), Skip(), SkipUntil(), and SubString().
Referenced by TokenizeLines().
def pump.RStripNewLineFromToken | ( | token | ) |
Referenced by TokenizeLines().
def pump.TokenizeLines | ( | lines, | |
pos | |||
) |
References Eof(), FindFirst(), MakeToken(), ParseExpTokenInParens(), ParseToken(), RStripNewLineFromToken(), Skip(), SkipUntil(), and SubString().
Referenced by Tokenize().
def pump.Tokenize | ( | s | ) |
A generator that yields the tokens in the given string.
References TokenizeLines().
Referenced by ParseToAST().
def pump.PopFront | ( | a_list | ) |
Referenced by ParseAtomicCodeNode(), and PopToken().
def pump.PushFront | ( | a_list, | |
elem | |||
) |
Referenced by ParseAtomicCodeNode().
def pump.PopToken | ( | a_list, | |
token_type = None |
|||
) |
References PopFront().
Referenced by ParseAtomicCodeNode(), and ParseElseNode().
def pump.PeekToken | ( | a_list | ) |
Referenced by ParseAtomicCodeNode(), and ParseElseNode().
def pump.ParseExpNode | ( | token | ) |
Referenced by ParseAtomicCodeNode(), and ParseElseNode().
def pump.ParseElseNode | ( | tokens | ) |
References ParseCodeNode(), ParseExpNode(), PeekToken(), and PopToken().
Referenced by ParseAtomicCodeNode().
def pump.ParseAtomicCodeNode | ( | tokens | ) |
References ParseCodeNode(), ParseElseNode(), ParseExpNode(), PeekToken(), PopFront(), PopToken(), and PushFront().
Referenced by ParseCodeNode().
def pump.ParseCodeNode | ( | tokens | ) |
References ParseAtomicCodeNode().
Referenced by ParseAtomicCodeNode(), ParseElseNode(), and ParseToAST().
def pump.ParseToAST | ( | pump_src_text | ) |
Convert the given Pump source text into an AST.
References ParseCodeNode(), and Tokenize().
Referenced by ConvertFromPumpSource().
def pump.RunCode | ( | env, | |
code_node, | |||
output | |||
) |
References RunAtomicCode().
Referenced by ConvertFromPumpSource(), and RunAtomicCode().
def pump.IsSingleLineComment | ( | cur_line | ) |
Referenced by WrapLongLine().
def pump.IsInPreprocessorDirective | ( | prev_lines, | |
cur_line | |||
) |
Referenced by WrapLongLine().
def pump.WrapComment | ( | line, | |
output | |||
) |
Referenced by WrapLongLine().
def pump.WrapCode | ( | line, | |
line_concat, | |||
output | |||
) |
Referenced by WrapPlainCode(), and WrapPreprocessorDirective().
def pump.WrapPreprocessorDirective | ( | line, | |
output | |||
) |
References WrapCode().
Referenced by WrapLongLine().
def pump.WrapPlainCode | ( | line, | |
output | |||
) |
References WrapCode().
Referenced by WrapLongLine().
def pump.IsMultiLineIWYUPragma | ( | line | ) |
Referenced by WrapLongLine().
def pump.IsHeaderGuardIncludeOrOneLineIWYUPragma | ( | line | ) |
Referenced by WrapLongLine().
def pump.WrapLongLine | ( | line, | |
output | |||
) |
def pump.BeautifyCode | ( | string | ) |
References WrapLongLine().
Referenced by ConvertFromPumpSource().
def pump.ConvertFromPumpSource | ( | src_text | ) |
Return the text generated from the given Pump source text.
References BeautifyCode(), ParseToAST(), RunCode(), and StripMetaComments().
Referenced by main().
def pump.main | ( | argv | ) |
References ConvertFromPumpSource().
pump.ID_REGEX = re.compile(r'[_A-Za-z]\w*') |
pump.EQ_REGEX = re.compile(r'=') |
pump.REST_OF_LINE_REGEX = re.compile(r'.*?(?=$|\$\$)') |
pump.OPTIONAL_WHITE_SPACES_REGEX = re.compile(r'\s*') |
pump.WHITE_SPACE_REGEX = re.compile(r'\s') |
pump.DOT_DOT_REGEX = re.compile(r'\.\.') |