MacroParser#

Qualified name: makros.macro\_creation.MacroParser

class makros.macro_creation.MacroParser#

Bases: ABC

This is a base class for you to implement! You need to fill out all of the attached methods to make it work.

Note: You must name the class that extends this Parser or else it will be picked up by makros

Methods

parse

This method is called to parse the tokens provided to it.

abstract parse(tokens: Tokens) any#

This method is called to parse the tokens provided to it. It should parse all of the tokens required and then return once it has reached the end of the macro

Args:

tokens (Tokens): The tokens that should be parsed

Returns:

any: The AST that is output by the parser. This will be passed into the translator later.