Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
 … an ABNF Parser Generator
Functions
apg_py.api.scanner_callbacks Namespace Reference

Functions

def scanner_line (state, input, phrase_index, phrase_length, data)
 Add a line to the line catalog. More...
 
def scanner_last_line (state, input, phrase_index, phrase_length, data)
 Deal with a last line with no line ending. More...
 
def scanner_line_text (state, input, phrase_index, phrase_length, data)
 Capture the line text (integers from beginning of line to end.) More...
 
def scanner_invalid (state, input, phrase_index, phrase_length, data)
 Handle an invalid character. More...
 
def scanner_end (state, input, phrase_index, phrase_length, data)
 Keep track of the current line number. More...
 
def scanner_lf (state, input, phrase_index, phrase_length, data)
 Recognize a line feed line ending. More...
 
def scanner_cr (state, input, phrase_index, phrase_length, data)
 Recognize a carriage return line ending. More...
 
def scanner_crlf (state, input, phrase_index, phrase_length, data)
 Recognize a carriage return, line feed combination line ending. More...
 

Function Documentation

◆ scanner_cr()

def apg_py.api.scanner_callbacks.scanner_cr (   state,
  input,
  phrase_index,
  phrase_length,
  data 
)

Recognize a carriage return line ending.

Parameters
stateThe tranlation state,
  • SEM_PRE the translation is traversing the node going down
  • SEM_POST the translation is traversing the node going up
inputThe full tuple of input integers.
phrase_indexThe index of the first integer in the matched phrase.
phrase_lengthThe number of integers in the matched phrase.
dataUser data that was passed to the AST translation, if any. This is available for the user and is never examined, used or changed by the AST translator.

Definition at line 149 of file scanner_callbacks.py.

◆ scanner_crlf()

def apg_py.api.scanner_callbacks.scanner_crlf (   state,
  input,
  phrase_index,
  phrase_length,
  data 
)

Recognize a carriage return, line feed combination line ending.

Parameters
stateThe tranlation state,
  • SEM_PRE the translation is traversing the node going down
  • SEM_POST the translation is traversing the node going up
inputThe full tuple of input integers.
phrase_indexThe index of the first integer in the matched phrase.
phrase_lengthThe number of integers in the matched phrase.
dataUser data that was passed to the AST translation, if any. This is available for the user and is never examined, used or changed by the AST translator.

Definition at line 174 of file scanner_callbacks.py.

◆ scanner_end()

def apg_py.api.scanner_callbacks.scanner_end (   state,
  input,
  phrase_index,
  phrase_length,
  data 
)

Keep track of the current line number.

Parameters
stateThe tranlation state,
  • SEM_PRE the translation is traversing the node going down
  • SEM_POST the translation is traversing the node going up
inputThe full tuple of input integers.
phrase_indexThe index of the first integer in the matched phrase.
phrase_lengthThe number of integers in the matched phrase.
dataUser data that was passed to the AST translation, if any. This is available for the user and is never examined, used or changed by the AST translator.

Definition at line 107 of file scanner_callbacks.py.

◆ scanner_invalid()

def apg_py.api.scanner_callbacks.scanner_invalid (   state,
  input,
  phrase_index,
  phrase_length,
  data 
)

Handle an invalid character.

Parameters
stateThe tranlation state,
  • SEM_PRE the translation is traversing the node going down
  • SEM_POST the translation is traversing the node going up
inputThe full tuple of input integers.
phrase_indexThe index of the first integer in the matched phrase.
phrase_lengthThe number of integers in the matched phrase.
dataUser data that was passed to the AST translation, if any. This is available for the user and is never examined, used or changed by the AST translator.

Definition at line 84 of file scanner_callbacks.py.

◆ scanner_last_line()

def apg_py.api.scanner_callbacks.scanner_last_line (   state,
  input,
  phrase_index,
  phrase_length,
  data 
)

Deal with a last line with no line ending.

Parameters
stateThe tranlation state,
  • SEM_PRE the translation is traversing the node going down
  • SEM_POST the translation is traversing the node going up
inputThe full tuple of input integers.
phrase_indexThe index of the first integer in the matched phrase.
phrase_lengthThe number of integers in the matched phrase.
dataUser data that was passed to the AST translation, if any. This is available for the user and is never examined, used or changed by the AST translator.

Definition at line 34 of file scanner_callbacks.py.

◆ scanner_lf()

def apg_py.api.scanner_callbacks.scanner_lf (   state,
  input,
  phrase_index,
  phrase_length,
  data 
)

Recognize a line feed line ending.

Parameters
stateThe tranlation state,
  • SEM_PRE the translation is traversing the node going down
  • SEM_POST the translation is traversing the node going up
inputThe full tuple of input integers.
phrase_indexThe index of the first integer in the matched phrase.
phrase_lengthThe number of integers in the matched phrase.
dataUser data that was passed to the AST translation, if any. This is available for the user and is never examined, used or changed by the AST translator.

Definition at line 124 of file scanner_callbacks.py.

◆ scanner_line()

def apg_py.api.scanner_callbacks.scanner_line (   state,
  input,
  phrase_index,
  phrase_length,
  data 
)

Add a line to the line catalog.

Parameters
stateThe tranlation state,
  • SEM_PRE the translation is traversing the node going down
  • SEM_POST the translation is traversing the node going up
inputThe full tuple of input integers.
phrase_indexThe index of the first integer in the matched phrase.
phrase_lengthThe number of integers in the matched phrase.
dataUser data that was passed to the AST translation, if any. This is available for the user and is never examined, used or changed by the AST translator.

Definition at line 7 of file scanner_callbacks.py.

◆ scanner_line_text()

def apg_py.api.scanner_callbacks.scanner_line_text (   state,
  input,
  phrase_index,
  phrase_length,
  data 
)

Capture the line text (integers from beginning of line to end.)

Parameters
stateThe tranlation state,
  • SEM_PRE the translation is traversing the node going down
  • SEM_POST the translation is traversing the node going up
inputThe full tuple of input integers.
phrase_indexThe index of the first integer in the matched phrase.
phrase_lengthThe number of integers in the matched phrase.
dataUser data that was passed to the AST translation, if any. This is available for the user and is never examined, used or changed by the AST translator.

Definition at line 67 of file scanner_callbacks.py.

Python APG, Version 1.0, is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.