Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
CodeGeneration[LanguageDefinition][Add] - add language definition
CodeGeneration[LanguageDefinition][Get] - get language definition
Calling Sequence
CodeGeneration[LanguageDefinition][Add](langname, moddef)
CodeGeneration[LanguageDefinition][Get](langname)
Parameters
langname
-
string; name of target language
moddef
module definition; defines a target language
Description
The Add function adds the module definition that defines the language langname to CodeGeneration's table of recognized languages. This language is then available for use by Translate and Get.
The Get function retrieves the module definition defining language langname. Note that Get will return a module definition for any defined language, regardless of whether the language has been defined using Define or Add.
The module definition moddef must satisfy certain criteria: see LanguageModule.
Examples
Define a language "AddExample" that translates the sin function as "Sine". Add it to CodeGeneration with Add, and perform a translation.
moddef := 'module() export PrintTarget, Printer; PrintTarget := proc() Printer:-PrintTarget(args); end proc: Printer := eval(LanguageDefinition[Get]("default")):-Printer; Printer:-AddFunction("sin", [anything]::anything, "Sine"); Printer:-AddOperator(Names:-Assignment = ":="); end module':
cg := Sine(x);
See Also
Define, Language Definition Overview, LanguageDefinition, LanguageModule
Download Help Document
Copyright © MathResources Inc. All Rights Reserved.
www.mathresources.com