from ast_generator.constants import Grammar GAZPREA_TOP_LEVEL: Grammar = { # Top level elements '': [''], '': ['blockblock'], # TODO constants # Routines '': ['', ''], # TODO forward_declaration '': [ 'function name="_NAME_" return_type="_TYPE_" args="_ARGS_"function'], '': [ 'procedure name="_NAME_" return_type="_TYPE_" args="_ARGS_"procedure'], '': [ 'procedure name="main" return_type="int" args="()"procedure'], '': ['', ''], # Blocks '': ['blockblock'], '': ['blockblock'], '': [ '', '', # '', # '', # TODO if/else, loop ], '': ['', ''], # Things that belong on their own lines '': ['declarationdeclaration'], '': [''], #, ''], '': ['returnreturn'], '': ['stream type="std_output"stream'], # '': ['stream type="std_input"stream'], # Things that are part of lines '': ['', '', ''], '': ['lhslhs'], '': ['rhsrhs'], # Things that have values '': ['operatoroperator'], '': ['variable mut="_MODIFIER_" type="_TYPE_" name="_NAME_"'], '': ['literal type="_TYPE_" value="_VALUE_"'], # Helper rules '': ['<'], '': ['>'], '': ['/>'], '': ['