Robot Framework
robot.parsing.model.statements.Statement Class Reference
Inheritance diagram for robot.parsing.model.statements.Statement:
robot.parsing.model.statements.Comment robot.parsing.model.statements.Config robot.parsing.model.statements.DocumentationOrMetadata robot.parsing.model.statements.EmptyLine robot.parsing.model.statements.Error robot.parsing.model.statements.ExceptHeader robot.parsing.model.statements.Fixture robot.parsing.model.statements.ForHeader robot.parsing.model.statements.IfElseHeader robot.parsing.model.statements.KeywordCall robot.parsing.model.statements.KeywordName robot.parsing.model.statements.LibraryImport robot.parsing.model.statements.MultiValue robot.parsing.model.statements.NoArgumentHeader robot.parsing.model.statements.ResourceImport robot.parsing.model.statements.ReturnStatement robot.parsing.model.statements.SectionHeader robot.parsing.model.statements.SingleValue robot.parsing.model.statements.TemplateArguments robot.parsing.model.statements.TestCaseName robot.parsing.model.statements.Variable robot.parsing.model.statements.VariablesImport robot.parsing.model.statements.WhileHeader

Public Member Functions

def __getitem__ (self, item)
 
def __init__ (self, tokens, errors=())
 
def __iter__ (self)
 
def __len__ (self)
 
def __repr__ (self)
 
def from_params (cls, *args, **kwargs)
 Create statement from passed parameters. More...
 
def from_tokens (cls, tokens)
 
def get_token (self, *types)
 Return a token with the given type. More...
 
def get_tokens (self, *types)
 Return tokens having any of the given types. More...
 
def get_value (self, type, default=None)
 Return value of a token with the given type. More...
 
def get_values (self, *types)
 Return values of tokens having any of the given types. More...
 
def register (cls, subcls)
 
def validate (self, context)
 

Public Attributes

 errors
 
 tokens
 

Static Public Attributes

tuple handles_types = ()
 
 type = None
 

Properties

 col_offset = property
 
 data_tokens = property
 
 end_col_offset = property
 
 end_lineno = property
 
 lineno = property
 
 lines = property
 

Private Member Functions

def col_offset (self)
 
def data_tokens (self)
 
def end_col_offset (self)
 
def end_lineno (self)
 
def lineno (self)
 
def lines (self)
 

Static Private Attributes

tuple _attributes
 
tuple _fields
 
dictionary _statement_handlers
 

Detailed Description

Definition at line 31 of file statements.py.

Constructor & Destructor Documentation

◆ __init__()

def robot.parsing.model.statements.Statement.__init__ (   self,
  tokens,
  errors = () 
)

Definition at line 47 of file statements.py.

Member Function Documentation

◆ __getitem__()

def robot.parsing.model.statements.Statement.__getitem__ (   self,
  item 
)

Definition at line 166 of file statements.py.

◆ __iter__()

def robot.parsing.model.statements.Statement.__iter__ (   self)

Definition at line 160 of file statements.py.

◆ __len__()

def robot.parsing.model.statements.Statement.__len__ (   self)

Definition at line 163 of file statements.py.

◆ __repr__()

def robot.parsing.model.statements.Statement.__repr__ (   self)

Definition at line 169 of file statements.py.

◆ col_offset()

def robot.parsing.model.statements.Statement.col_offset (   self)
private

Definition at line 60 of file statements.py.

◆ data_tokens()

def robot.parsing.model.statements.Statement.data_tokens (   self)
private

Definition at line 113 of file statements.py.

◆ end_col_offset()

def robot.parsing.model.statements.Statement.end_col_offset (   self)
private

Definition at line 72 of file statements.py.

◆ end_lineno()

def robot.parsing.model.statements.Statement.end_lineno (   self)
private

Definition at line 66 of file statements.py.

◆ from_params()

def robot.parsing.model.statements.Statement.from_params (   cls,
args,
**  kwargs 
)

Create statement from passed parameters.

    Required and optional arguments should match class properties. Values are
    used to create matching tokens.

    There is one notable difference for `Documentation` statement where
    ``settings_header`` flag is used to determine if statement belongs to
    settings header or test/keyword.

    Most implementations support following general properties:
    - ``separator`` whitespace inserted between each token. Default is four spaces.
    - ``indent`` whitespace inserted before first token. Default is four spaces.
    - ``eol`` end of line sign. Default is ``'\\n'``.

Definition at line 107 of file statements.py.

◆ from_tokens()

def robot.parsing.model.statements.Statement.from_tokens (   cls,
  tokens 
)

Definition at line 83 of file statements.py.

◆ get_token()

def robot.parsing.model.statements.Statement.get_token (   self,
types 
)

Return a token with the given type.

    If there are no matches, return ``None``. If there are multiple
    matches, return the first match.

Definition at line 121 of file statements.py.

◆ get_tokens()

def robot.parsing.model.statements.Statement.get_tokens (   self,
types 
)

Return tokens having any of the given types.

Definition at line 128 of file statements.py.

◆ get_value()

def robot.parsing.model.statements.Statement.get_value (   self,
  type,
  default = None 
)

Return value of a token with the given type.

    If there are no matches, return ``default``. If there are multiple
    matches, return the value of the first match.

Definition at line 136 of file statements.py.

◆ get_values()

def robot.parsing.model.statements.Statement.get_values (   self,
types 
)

Return values of tokens having any of the given types.

Definition at line 141 of file statements.py.

◆ lineno()

def robot.parsing.model.statements.Statement.lineno (   self)
private

Definition at line 54 of file statements.py.

◆ lines()

def robot.parsing.model.statements.Statement.lines (   self)
private

Definition at line 147 of file statements.py.

◆ register()

def robot.parsing.model.statements.Statement.register (   cls,
  subcls 
)

Definition at line 76 of file statements.py.

◆ validate()

Member Data Documentation

◆ _attributes

robot.parsing.model.statements.Statement._attributes
staticprivate

Definition at line 41 of file statements.py.

◆ _fields

robot.parsing.model.statements.Statement._fields
staticprivate

Definition at line 37 of file statements.py.

◆ _statement_handlers

robot.parsing.model.statements.Statement._statement_handlers
staticprivate

Definition at line 45 of file statements.py.

◆ errors

robot.parsing.model.statements.Statement.errors

Definition at line 49 of file statements.py.

◆ handles_types

tuple robot.parsing.model.statements.Statement.handles_types = ()
static

Definition at line 33 of file statements.py.

◆ tokens

robot.parsing.model.statements.Statement.tokens

Definition at line 48 of file statements.py.

◆ type

robot.parsing.model.statements.Statement.type = None
static

Definition at line 32 of file statements.py.

Property Documentation

◆ col_offset

robot.parsing.model.statements.Statement.col_offset = property
static

Definition at line 58 of file statements.py.

◆ data_tokens

robot.parsing.model.statements.Statement.data_tokens = property
static

Definition at line 111 of file statements.py.

◆ end_col_offset

robot.parsing.model.statements.Statement.end_col_offset = property
static

Definition at line 70 of file statements.py.

◆ end_lineno

robot.parsing.model.statements.Statement.end_lineno = property
static

Definition at line 64 of file statements.py.

◆ lineno

robot.parsing.model.statements.Statement.lineno = property
static

Definition at line 52 of file statements.py.

◆ lines

robot.parsing.model.statements.Statement.lines = property
static

Definition at line 145 of file statements.py.


The documentation for this class was generated from the following file: