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
Printer:-AddOperator - add translation for operator
Printer:-GetOperator - get translation for operator
Calling Sequence
Printer:-AddOperator(operatorname = translation)
Printer:-GetOperator(operatorname)
Parameters
Printer
-
Printer module
operatorname
name; operator supported by CodeGeneration
translation
string; equivalent of operator in target language
Description
The AddOperator command defines a string representing the a prefix unary or infix binary operator in a Printer module corresponding to a target language.
The operatorname parameter can be one of the following members of CodeGeneration:-Names: And, Not, Or, Equal, Less, LessEqual, NotEqual, Power, Product, Sum, Inverse, Negation, Exponentiation, Multiplication, Addition, Subtraction, Division, Assignment.
The GetOperator command returns the string representing the target language equivalent for operatorname.
Examples
Define a language that resembles C, but uses . for multiplication.
LanguageDefinition[Define]( "C_with_dot", extend="C", AddOperator( Names:-Multiplication = "." ) ): p := proc(x,y) 2*x end proc: Translate(p, language="C_with_dot");
int p (int x, double y) { return(2 . x); }
See Also
Names, Printer
Download Help Document
Copyright © MathResources Inc. All Rights Reserved.
www.mathresources.com