Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
Overview of the LanguageDefinition Subpackage
Calling Sequence
LanguageDefinition[command](arguments)
command(arguments)
Description
With the LanguageDefinition subpackage, you can enable CodeGeneration to perform translations to new, user-defined languages.
The Translate command translates Maple code to any specified language currently recognized by CodeGeneration. A language is recognized if it is one of the pre-defined languages supported by CodeGeneration, or if it has been defined for use by CodeGeneration with Add or Define.
Code translation in the CodeGeneration package operates by first translating Maple input to a intermediate structure . This is followed by the printing phase, in which the work of translation to the new language is done. During this phase, the intermediate form is traversed, and at each node in the expression tree, a language-specific print handler procedure is called, which is responsible for issuing the necessary statements to translate a given subexpression of the intermediate form into a string.
Necessary Steps for Defining a Language
There are two distinct methods by which you can enable CodeGeneration to perform translations from Maple to a new target language.
Create a language module. You can create a language module by extending an existing language module or defining a new module. For information, see Language Definition Module. Once created, add this module to the set of languages recognized by CodeGeneration with the Add command.
Define the language with Define.
Once you have defined the language by either of these methods, you can perform translations to the new language using Translate.
To save your language definition in order to make it available for use in later sessions, use the Save command.
List of CodeGeneration[LanguageDefinition] Commands
The following is a list of available commands in the CodeGeneration[LanguageDefinition] subpackage.
Add
DefaultPrinter
Define
GenericPrinter
Get
IsDefined
ListLanguages
Sample Source Code
Sample source code associated with each of the built-in translators is located in the samples\\CodeGeneration directory of your Maple installation. These examples of large scale language translators are provided as a reference for users seeking to write custom translators.
See Also
CodeGeneration, LanguageModule, Translate
Download Help Document