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
Printer:-AddType - add a type to Printer module
Printer:-GetType - get a type from a Printer module
Calling Sequence
Printer:-AddType(typename = translation)
Printer:-GetType(typename)
Parameters
Printer
-
Printer module
typename
type supported by CodeGeneration
translation
string or table; translation for type in target language
Description
The AddType command defines the translation for the type typename in the target language with which Printer is associated. This is commonly used in the printing of Coercion and Declaration intermediate code structures.
If translation is a table, its indices must be the allowed precisions for typename in this target language. The table entry corresponding to the current precision (set by the precision option) for the type typename is used as the translation for typename.
The GetType command returns the translation for type typename in the target language.
Examples
p1 := proc(x,y) local a; a := 2*f(x); 3.0*a*y;end proc:
Translate to language . Notice that the type integer is translated to custom_int while the type numeric is translated to custom_float_double.
custom_float_double p1 (custom_int x, custom_float_double y) { custom_int a; a = 2 * f_equiv(x); return(0.30e1 * (custom_float_double) a * y); }
Same as previous, but force translation of type numeric as custom_float_single by including the option precision = single.
custom_float_single p1 (custom_int x, custom_float_single y) { custom_int a; a = 2 * f_equiv(x); return(0.30e1 * (custom_float_single) a * y); }
See Also
CGOptions, Printer
Download Help Document
Copyright © MathResources Inc. All Rights Reserved.
www.mathresources.com