General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
|
Tutorial on Name AnalysisPredefined IdentifiersAllmost all languages have certain identifiers that are predefined for any program. This facility is demonstrated by introducing typed variable declarations to our language: Predef.con[11]== Declaration: 'var' VarDecls ';'. VarDecls: VarDecl // ','. VarDecl: TypeUseIdent DefIdent. TypeUseIdent: Ident. This macro is attached to a product file.
The type of a declared variable is given by a Predef.lido[12]== SYMBOL TypeUseIdent INHERITS IdUseEnv, IdentOcc END; This macro is attached to a product file.
The technique for predefining identifiers is provided by the
library modules Predef.specs[13]== $/Name/PreDefine.gnrc+referto=Ident:inst $/Name/PreDefId.gnrc+referto=(Predef.d):inst This macro is attached to a product file. Predef.d[14]== PreDefKey ("int", intKey) PreDefKey ("real", realKey) PreDefKey ("bool", boolKey) PreDefKey ("true", trueKey) PreDefKey ("false", falseKey) This macro is attached to a product file.
|