robot.parsing.parser package
Submodules
robot.parsing.parser.blockparsers module
- classrobot.parsing.parser.blockparsers.BlockParser(model:Block)[source]
Bases:
Parser,ABC- unhandled_tokens={'COMMENTHEADER','INVALIDHEADER','KEYWORDHEADER','KEYWORDNAME','SETTINGHEADER','TASKHEADER','TESTCASEHEADER','TESTCASENAME','VARIABLEHEADER'}
- parse(statement:Statement)→BlockParser|None[source]
- classrobot.parsing.parser.blockparsers.TestCaseParser(model:Block)[source]
Bases:
BlockParser
- classrobot.parsing.parser.blockparsers.KeywordParser(model:Block)[source]
Bases:
BlockParser
- classrobot.parsing.parser.blockparsers.NestedBlockParser(model:NestedBlock,handle_end:bool=True)[source]
Bases:
BlockParser,ABC- model:NestedBlock
- parse(statement:Statement)→BlockParser|None[source]
- classrobot.parsing.parser.blockparsers.ForParser(model:NestedBlock,handle_end:bool=True)[source]
Bases:
NestedBlockParser
- classrobot.parsing.parser.blockparsers.WhileParser(model:NestedBlock,handle_end:bool=True)[source]
Bases:
NestedBlockParser
- classrobot.parsing.parser.blockparsers.GroupParser(model:NestedBlock,handle_end:bool=True)[source]
Bases:
NestedBlockParser
- classrobot.parsing.parser.blockparsers.IfParser(model:NestedBlock,handle_end:bool=True)[source]
Bases:
NestedBlockParser- parse(statement:Statement)→BlockParser|None[source]
- classrobot.parsing.parser.blockparsers.TryParser(model:NestedBlock,handle_end:bool=True)[source]
Bases:
NestedBlockParser- parse(statement)→BlockParser|None[source]
robot.parsing.parser.fileparser module
- classrobot.parsing.parser.fileparser.FileParser(source:Path|str|TextIO|None=None)[source]
Bases:
Parser- parse(statement:Statement)→SectionParser[source]
- classrobot.parsing.parser.fileparser.SettingSectionParser(model:Container)[source]
Bases:
SectionParser- model:SettingSection
- classrobot.parsing.parser.fileparser.VariableSectionParser(model:Container)[source]
Bases:
SectionParser- model:VariableSection
- classrobot.parsing.parser.fileparser.CommentSectionParser(model:Container)[source]
Bases:
SectionParser- model:CommentSection
- classrobot.parsing.parser.fileparser.ImplicitCommentSectionParser(model:Container)[source]
Bases:
SectionParser- model:ImplicitCommentSection
- classrobot.parsing.parser.fileparser.InvalidSectionParser(model:Container)[source]
Bases:
SectionParser- model:InvalidSection
- classrobot.parsing.parser.fileparser.TestCaseSectionParser(model:Container)[source]
Bases:
SectionParser- model:TestCaseSection
- classrobot.parsing.parser.fileparser.KeywordSectionParser(model:Container)[source]
Bases:
SectionParser- model:KeywordSection
robot.parsing.parser.parser module
- robot.parsing.parser.parser.get_model(source:Path|str|TextIO,data_only:bool=False,curdir:str|None=None,lang:Languages|Language|str|Path|Iterable[Language|str|Path]|None=None)→File[source]
Parses the given source into a model represented as an AST.
How to use the model is explained more thoroughly in the generaldocumentation of the
robot.parsingmodule.- Parameters:
source – The source where to read the data. Can be a path toa source file as a string or as
pathlib.Pathobject, an alreadyopened file object, or Unicode text containing the date directly.Source files must be UTF-8 encoded.data_only – When
False(default), returns all tokens. When settoTrue, omits separators, comments, continuation markers, andother non-data tokens. Model like this cannot be saved back tofile system.curdir – Directory where the source file exists. This path is usedto set the value of the built-in
${CURDIR}variable during parsing.When not given, the variable is left as-is. Should only be givenonly if the model will be executed afterward. If the model is savedback to disk, resolving${CURDIR}is typically not a good idea.lang – Additional languages to be supported during parsing.Can be a string matching any of the supported language codes or names,an initialized
Languagesubclass,a list containing such strings or instances, or aLanguagesinstance.
Use
get_resource_model()orget_init_model()when parsingresource or suite initialization files, respectively.
- robot.parsing.parser.parser.get_resource_model(source:Path|str|TextIO,data_only:bool=False,curdir:str|None=None,lang:Languages|Language|str|Path|Iterable[Language|str|Path]|None=None)→File[source]
Parses the given source into a resource file model.
Same as
get_model()otherwise, but the source is considered to bea resource file. This affects, for example, what settings are valid.
- robot.parsing.parser.parser.get_init_model(source:Path|str|TextIO,data_only:bool=False,curdir:str|None=None,lang:Languages|Language|str|Path|Iterable[Language|str|Path]|None=None)→File[source]
Parses the given source into an init file model.
Same as
get_model()otherwise, but the source is considered to bea suite initialization file. This affects, for example, what settings arevalid.