Intermediate Code Names - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Code Generation Package : Intermediate Code Names

Intermediate Code Names

• 

The basic structure on which both built-in and user-created language definitions operate is the intermediate form, an expression tree made of nested function calls representing a simplified form of the Maple input.

• 

For a detailed listing of the members of the CodeGeneration:-Names subpackage and their function within the intermediate form, see Intermediate Code Structure.

• 

The names of the functions in the intermediate form are members of the Names subpackage of the CodeGeneration package.  When writing a language definition module, it is frequently necessary to refer to these names, and is therefore often useful to use the use statement with the CodeGeneration:-Names subpackage.

Examples

useCodeGeneration:-NamesinCodeGenerationLanguageDefinitionDefineSomeLanguage,extend=default,AddOperatorAssignment=:=,AddPrintHandlerInteger=x→Printer:-Printconvertx,'string'end use:

CodeGenerationTranslatex=2,language=SomeLanguage

x := 2;

CodeGenerationLanguageDefinitionDefineSomeOtherLanguage,extend=SomeLanguage,AddFunctionGAMMA,numeric::numeric,gamma,AddFunctionGAMMA,integer::numeric,gamma,AddFunctionfactorial,integer::numeric,x→Printer:-PrintCodeGeneration:-Names:-SumCodeGeneration:-Names:-FunctionCallNameGAMMA,CodeGeneration:-Names:-ExpressionSequencex,integer::numeric,CodeGeneration:-Names:-Integer1:

CodeGenerationTranslaten!,language=SomeOtherLanguage

cg := gamma(n) + 1;

See Also

Intermediate Code

Intermediate Code Structure