devana.preprocessing.premade.components.parser
devana.preprocessing.premade.components.parser.argumentsparser
- class ArgumentGenericTypeParser(pattern, value_creator)[source]
Bases:
IParsable
Universal type parser created based on regex and callback function or based on enum to create enum parser.
- parse(text, dispatcher)[source]
Should get text and return parsed token as python value (except named argument - it is a dictionary). This method should call dispatcher argument with the rest of the text string to allow to parse the whole text with recursion. For example [value, *dispatcher(test_text)] is a typical return value.
- Return type
Union
[List
[Any
],Type
[NoValue
]]
- class ArgumentsParser(extra_parsers=None)[source]
Bases:
object
Helper class to parse function arguments (provided as text) and return list of python values.
- class IParsable[source]
Bases:
ABC
Interface for parsable token element.
- end_pattern = '\\s*((?P<comma>,.*)|(?P<empty>\\s*))$'
- abstract parse(text, dispatcher)[source]
Should get text and return parsed token as python value (except named argument - it is a dictionary). This method should call dispatcher argument with the rest of the text string to allow to parse the whole text with recursion. For example [value, *dispatcher(test_text)] is a typical return value.
- Return type
Union
[List
[Any
],Type
[NoValue
]]
- class ListArgumentParser[source]
Bases:
IParsable
Implementation of a parsing list type.
- parse(text, dispatcher)[source]
Should get text and return parsed token as python value (except named argument - it is a dictionary). This method should call dispatcher argument with the rest of the text string to allow to parse the whole text with recursion. For example [value, *dispatcher(test_text)] is a typical return value.
- Return type
Union
[List
[Any
],Type
[NoValue
]]
- class NameArgumentParser[source]
Bases:
IParsable
Implementation of parsing named argument like name=value.
- parse(text, dispatcher)[source]
Should get text and return parsed token as python value (except named argument - it is a dictionary). This method should call dispatcher argument with the rest of the text string to allow to parse the whole text with recursion. For example [value, *dispatcher(test_text)] is a typical return value.
- Return type
Union
[List
[Any
],Type
[NoValue
]]
devana.preprocessing.premade.components.parser.extractor
- class CommentExtractor(modules, file_filter=None)[source]
Bases:
IExtractor
This function extracts function parsable data from comments in C++ source files.
- extract()[source]
Extract from source - managed by this class - to specifics data.
- Return type
List
[ExtractedFunction
]
- class ExtractedFunction(text, parent)[source]
Bases:
object
One line (can contain none, one or more functions) of text and parent of this line.
- parent: ISyntaxElement
- text: str
- class IExtractor[source]
Bases:
ABC
Interface for extract functions strings to parser.
- abstract extract()[source]
Extract from source - managed by this class - to specifics data.
- Return type
List
[ExtractedFunction
]
devana.preprocessing.premade.components.parser.functionparser
- class FunctionEntity(name, namespaces, arguments)[source]
Bases:
object
Parsing function information, argument are provided as string for another parser.
- arguments: str
- name: str
- namespaces: List[str]
- class FunctionParser[source]
Bases:
object
Class realized parsing function.
- class State(transactions, on_enter=<function FunctionParser.State.<lambda>>, on_exit=<function FunctionParser.State.<lambda>>, on_self=<function FunctionParser.State.<lambda>>)[source]
Bases:
object
State information of parser.
- on_enter()
- on_exit()
- on_self()
- class StateName(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
Name of state.
- ARGS = 5
- END = 8
- ERROR = 9
- FUNCTION_SEPARATOR = 4
- NAMESPACE = 2
- NAMESPACE_SEPARATOR = 3
- SEARCH = 1
- STRING = 6
- STRING_ESCAPE = 7
- parse(text)[source]
Parse line to find functions.
- Return type
List
[FunctionEntity
]
devana.preprocessing.premade.components.parser.parser
devana.preprocessing.premade.components.parser.typechecker
Components for create your own function calls parser for preprocessor.