[Next] [Previous] [Top]

"Pragmas and Vortex"

1 Pragma Syntax


(Reprised from the Cecil language specification and the Vortex RTL specification.)

The syntax of a pragma is as follows:

pragma	::=	"(**" exprs "**)"

In the body of a pragma, exprs is just a syntax tree. Individual pragmas will interpret this format in particular ways. exprs typically has the form name, optionally followed by (exprs'), where name is the name of the pragma and exprs' is a list of arguments to the pragma.

In a Cecil source file, a pragma may occur either as a top-level declaration or as part of a method, field, or variable declaration:

top_decl_block	::=	{ decl | pragma }
method_decl	::=	[privacy] impl_kind method_name
		    "(" [formals] ")" [type_decl] {pragma}
		    "{" (body | prim_body) "}" [";"]
field_decl	::=	[field_privacy] ["shared"] ["var"] "field" field_kind
		    msg_name [formal_params] "(" formal ")" [type_decl]
		    {pragma} [":=" expr] ";"
let_decl	::=	[privacy] "let" ["var"] name [type_decl] {pragma}
		    ":=" expr ";"

In an RTL source file, a pragma may occur as a top-level declaration or as part of an object, method, field, or variable declaration:

rtl_file	::=	{ rtl_decl | pragma }
rtl_object_decl	::=	[rtl_obj_role] "object" name ["isa" names]
		    {pragma|object_id_pragma} ";"
rtl_method_decl	::= 	"method" [rtl_visibility] rtl_name "(" {rtl_formals} ")"
		  ":" representation {pragma} "{" rtl_stmts "}" [";"]
rtl_extern_method_decl	::= 	"extern" "method" name "(" {rtl_formals} ")"
		  ":" representation {pragma} ";"
rtl_field_decl	::= 	["var"] [array_field_info] "field" [rtl_visibility] name
		  "(" rtl_formal ")" ":" representation {pragma}
		  [":=" literal] ";"
rtl_var_decl	::=	"decl" [rtl_visibility] representation name {pragma}
		  [":=" (literal | static_init)] ";"