Translate #
Translate (Syntax.translate) an abstract syntax tree Syntax.Ast.Ast
into a high level intermediate representation Syntax.Hir.
Equations
- Regex.Syntax.finish translator = match translator.stack.pop? with | some (frame, snd) => frame.unwrap_expr | none => Except.error "empty stack"
Instances For
Equations
- Regex.Syntax.start translator = translator
Instances For
This method is called on an Ast before descending into child Ast nodes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This method is called on an Ast after descending all of its child Ast nodes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This method is called on every [ClassSetItem] before descending into child nodes.
Equations
- One or more equations did not get rendered due to their size.
- Regex.Syntax.visit_class_set_item_pre ast = pure ()
Instances For
This method is called on every [ClassSetItem] after descending into child nodes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This method is called on every [ClassSetBinaryOp] before descending into child nodes.
Equations
- Regex.Syntax.visit_class_set_binary_op_pre = do let t ← get set { stack := t.stack.push (Regex.Syntax.HirFrame.ClassUnicode Regex.Syntax.ClassUnicode.empty), flags := t.flags }
Instances For
This method is called between the left hand and right hand child nodes.
Equations
- Regex.Syntax.visit_class_set_binary_op_in = do let t ← get set { stack := t.stack.push (Regex.Syntax.HirFrame.ClassUnicode Regex.Syntax.ClassUnicode.empty), flags := t.flags }
Instances For
This method is called on every [ClassSetBinaryOp] after descending into child nodes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Translate the given abstract syntax tree into a high level intermediate representation.
Equations
- Regex.Syntax.translate flags ast = Regex.Syntax.AstItems.visit Regex.Syntax.instVisitorHirTranslator { stack := #[], flags := flags } ast