[Next] [Previous] [Top]

"RTL Grammar"

1 Top-Level Entry Points


For Cecil RTL primitives, the syntax of the code string part of the prim_body is as follows:

rtl_prim	::=	rtl_stmts

For languages that have separate front-ends, such as Java, Smalltalk, C++, and Modula-3, source files are translated by the front-end into RTL files. An RTL file is described by the following grammar:

rtl_file	::=	{ rtl_decl | pragma }
rtl_decl	::= 	rtl_object_decl
	|	rtl_extend_decl
	|	rtl_method_decl
	|	rtl_extern_method_decl
	|	rtl_field_decl
	|	rtl_var_decl
	|	rtl_assoc_decl
	|	rtl_include_decl
	|	rtl_top_level_stmts
	|	rtl_prim_stmts

The RTL file should not declare a method named main as this function is defined by the Vortex back-end. Instead, code to initialize RTL program data structures and invoke top-level procedures (like the equivalent of main) should be included as top-level statement blocks. The global variables global_argc, global_argv, and global_envp can be referenced to get at the usual argc, argv, and envp parameters of main, and the global variable global_result should be assigned to set the desired integer return code for main.