Intermediate Code Names - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Code Generation Package : CodeGeneration/General/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:-NamesinCodeGeneration[LanguageDefinition]DefineSomeLanguage,extend=default,AddOperatorAssignment=:=,AddPrintHandlerInteger=x→Printer:-Printconvertx,'string'end use:

CodeGeneration[Translate]x=2,language=SomeLanguage

x := 2;

CodeGeneration[LanguageDefinition]DefineSomeOtherLanguage,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:

CodeGeneration[Translate]n!,language=SomeOtherLanguage

cg := gamma(n) + 1;

See Also

Intermediate Code, Intermediate Code Structure


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam