DefaultPrinter - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


CodeGeneration[LanguageDefinition]

  

DefaultPrinter

  

get generic printing module

 

Calling Sequence

Description

Examples

Calling Sequence

CodeGeneration[LanguageDefinition][DefaultPrinter]()

Description

• 

The DefaultPrinter command returns a Printer module which you can use when implementing a CodeGeneration translator.  You can override the defaults in this Printer module to provide custom translations for code represented in the Intermediate Code structure.

Examples

withCodeGeneration:

moddef := proc() module()
   export Printer, PrintTarget;
        Printer := LanguageDefinition:-DefaultPrinter();
        PrintTarget := proc() Printer:-PrintTarget(args); end proc:

        Printer:-AddFunction("cos", [numeric]::numeric, "MyCosine");
        Printer:-AddOperator(Names:-Assignment = "assigned to");
        Printer:-AddOperator(Names:-Addition   = "plus");
end module end proc:

LanguageDefinitionAddDefaultPrinterExample,moddef

Translatex=y+3,language=DefaultPrinterExample

x assigned to y plus 3;

See Also

CodeGeneration

CodeGenerationDetails

IntermediateCodeStructure