Belle II Software light-2406-ragdoll
B2ParameterLexer Class Reference
Inheritance diagram for B2ParameterLexer:
Collaboration diagram for B2ParameterLexer:

Public Member Functions

def ARGUMENTTUPLE (self, t)
 

Public Attributes

 index
 Increment current scanning position.
 

Static Public Attributes

dict tokens = {ARGUMENTTUPLE, }
 Single token for matching metavariable parameters.
 

Detailed Description

Lexer class responsible for changing the default scanning behavior.
It disables token scanning and captures
everything within the matched parenthesis.
Call pop_state to return to the default scanning state.

Definition at line 40 of file b2parser.py.

Member Function Documentation

◆ ARGUMENTTUPLE()

def ARGUMENTTUPLE (   self,
  t 
)
Capture metavariable parameters by finding the matched parenthesis.

Args:
    t (sly.lex.token): token of type LPAREN

Returns:
    t (sly.lex.token): ARGUMENTTUPLE token

Definition at line 51 of file b2parser.py.

51 def ARGUMENTTUPLE(self, t):
52 """
53 Capture metavariable parameters by finding the matched parenthesis.
54
55 Args:
56 t (sly.lex.token): token of type LPAREN
57
58 Returns:
59 t (sly.lex.token): ARGUMENTTUPLE token
60 """
61 # Find the offset of the matching parenthesis
62 pos = findMatchedParenthesis(self.text[self.index-1:], "(", ")")
63 # Set value to slice
64 t.value = self.text[self.index-1: self.index+pos]
65
66 self.index = self.index+pos
67 # Return to default B2Lexer state
68 self.pop_state()
69 # Return token
70 return t
71
72

Member Data Documentation

◆ index

index

Increment current scanning position.

Definition at line 66 of file b2parser.py.

◆ tokens

dict tokens = {ARGUMENTTUPLE, }
static

Single token for matching metavariable parameters.

Definition at line 48 of file b2parser.py.


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