get library inclusion statements - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Code Generation Package : Language Definition : Printer : CodeGeneration/LanguageDefinition/Printer/GetIncludes

Printer:-GetIncludes - get library inclusion statements

Calling Sequence

Printer:-GetIncludes()

Parameters

Printer

-

Printer module

Description

• 

When called after the printing of intermediate code, the GetIncludes command returns a string containing the commands necessary for including all libraries or packages which have been declared necessary during the printing phase with AddLibrary calls.

• 

The LibraryInclusion language attribute controls the formatting of the results returned by GetIncludes.

• 

The GetIncludes command is frequently called by PrintTarget in order to preface the generated code with any necessary include directives.

Examples

withCodeGeneration:

LanguageDefinition[Define]("GetIncludesExample",
   extend = "C",
   AddFunction(
       "show_libraries",
       [anything]::anything,
       proc()
           Printer:-Print(
               "printf(\"Library inclusion statements are: ",
               Printer:-GetIncludes(), "\")"
           )
       end proc
   )
):

Translatea=sinx,b=show_libraries,language=GetIncludesExample

a = sin(x);
b = (double) printf("Library inclusion statements are: #include <math.h>

");

See Also

AddLibrary, Language Attributes, Printer


Download Help Document

Copyright © MathResources Inc. All Rights Reserved.

www.mathresources.com

Was this information helpful?



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