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:-GetPrecedence - get precedence for intermediate code name
Printer:-SetPrecedence - set precedence for intermediate code name
Calling Sequence
Printer:-GetPrecedence(icname)
Printer:-SetPrecedence(icname, precedence)
Parameters
Printer
-
Printer module
icname
symbol; Intermediate Code name
precedence
integer
Description
The procedure GetPrecedence returns the precedence of icname.
The procedure SetPrecedence sets the precedence of icname to the value precedence. The actual value is irrelevant except in comparison with the precedence of other Intermediate Code expressions for this language.
Precedence controls how an expression is printed in the target language; specifically, it controls when it is necessary to print parentheses to protect an expression. For example, in most programming languages the precedence of multiplication is higher than that of addition, enabling x+y*z to be interpreted as x added to the product of y and z. But if, using SetPrecedence, you set the precedence of Addition to a higher value than that of Multiplication, the previous expression must be printed with parentheses for correctness.
Examples
m := 'module() export PrintTarget, Printer; Printer := eval(LanguageDefinition[Get]("C")):-Printer; PrintTarget := proc(ic, digits::posint, prec::name, func_prec, namelist)::string; Printer:-PrintTarget(args); end proc: # set precedence of addition higher than that of multiplication Printer:-SetPrecedence(Names:-Addition = Printer:-GetPrecedence(Names:-Multiplication)+5); end module':
cg = x * y + z;
See Also
Download Help Document
Copyright © MathResources Inc. All Rights Reserved.
www.mathresources.com