nemoguardrails.colang.v2_x.lang.transformer
nemoguardrails.colang.v2_x.lang.transformer
Module Contents
Classes
API
Bases: Transformer
A Lark transformer for transforming the parsing tree into the right internal structure.
It extracts the following:
- Flows
- Imports (TODO)
Default function that is called if there is no attribute matching data
Can be overridden. Defaults to creating
a new copy of the tree node (i.e. return Tree(data, children: list, meta))
Processing for flow tree nodes.
Processing for spec tree nodes.
Processing for name tree nodes.
We just copy the values from the children: list, which should be tokens.
The set statement can result in either a Set operation, or a SpecOp with a return value capturing.
Processing for spec tree nodes.
Processing for spec_op tree nodes.
Processing for spec tree nodes.
Helper to create an element of the specified type.