001: /*
002: * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: /*
026: * COMPONENT_NAME: idl.parser
027: *
028: * ORIGINS: 27
029: *
030: * Licensed Materials - Property of IBM
031: * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999
032: * RMI-IIOP v1.0
033: *
034: * @(#)DefaultExprFactory.java 1.21 07/05/05
035: */
036:
037: package com.sun.tools.corba.se.idl.constExpr;
038:
039: // NOTES:
040:
041: import com.sun.tools.corba.se.idl.ConstEntry;
042: import java.math.BigInteger;
043:
044: public class DefaultExprFactory implements ExprFactory {
045: public And and(Expression left, Expression right) {
046: return new And(left, right);
047: } // and
048:
049: public BooleanAnd booleanAnd(Expression left, Expression right) {
050: return new BooleanAnd(left, right);
051: } // booleanAnd
052:
053: public BooleanNot booleanNot(Expression operand) {
054: return new BooleanNot(operand);
055: } // booleanNot
056:
057: public BooleanOr booleanOr(Expression left, Expression right) {
058: return new BooleanOr(left, right);
059: } // booleanOr
060:
061: public Divide divide(Expression left, Expression right) {
062: return new Divide(left, right);
063: } // divide
064:
065: public Equal equal(Expression left, Expression right) {
066: return new Equal(left, right);
067: } // equal
068:
069: public GreaterEqual greaterEqual(Expression left, Expression right) {
070: return new GreaterEqual(left, right);
071: } // greaterEqual
072:
073: public GreaterThan greaterThan(Expression left, Expression right) {
074: return new GreaterThan(left, right);
075: } // greaterThan
076:
077: public LessEqual lessEqual(Expression left, Expression right) {
078: return new LessEqual(left, right);
079: } // lessEqual
080:
081: public LessThan lessThan(Expression left, Expression right) {
082: return new LessThan(left, right);
083: } // lessThan
084:
085: public Minus minus(Expression left, Expression right) {
086: return new Minus(left, right);
087: } // minus
088:
089: public Modulo modulo(Expression left, Expression right) {
090: return new Modulo(left, right);
091: } // modulo
092:
093: public Negative negative(Expression operand) {
094: return new Negative(operand);
095: } // negative
096:
097: public Not not(Expression operand) {
098: return new Not(operand);
099: } // not
100:
101: public NotEqual notEqual(Expression left, Expression right) {
102: return new NotEqual(left, right);
103: } // notEqual
104:
105: public Or or(Expression left, Expression right) {
106: return new Or(left, right);
107: } // or
108:
109: public Plus plus(Expression left, Expression right) {
110: return new Plus(left, right);
111: } // plus
112:
113: public Positive positive(Expression operand) {
114: return new Positive(operand);
115: } // positive
116:
117: public ShiftLeft shiftLeft(Expression left, Expression right) {
118: return new ShiftLeft(left, right);
119: } // shiftLeft
120:
121: public ShiftRight shiftRight(Expression left, Expression right) {
122: return new ShiftRight(left, right);
123: } // shiftRight
124:
125: public Terminal terminal(String representation,
126: Character charValue, boolean isWide) {
127: return new Terminal(representation, charValue, isWide);
128: } // ctor
129:
130: public Terminal terminal(String representation, Boolean booleanValue) {
131: return new Terminal(representation, booleanValue);
132: } // ctor
133:
134: // Support long long <daz>
135: public Terminal terminal(String representation,
136: BigInteger bigIntegerValue) {
137: return new Terminal(representation, bigIntegerValue);
138: } // ctor
139:
140: //daz public Terminal terminal (String representation, Long longValue)
141: // {
142: // return new Terminal (representation, longValue);
143: // } // ctor
144:
145: public Terminal terminal(String representation, Double doubleValue) {
146: return new Terminal(representation, doubleValue);
147: } // ctor
148:
149: public Terminal terminal(String stringValue, boolean isWide) {
150: return new Terminal(stringValue, isWide);
151: } // ctor
152:
153: public Terminal terminal(ConstEntry constReference) {
154: return new Terminal(constReference);
155: } // ctor
156:
157: public Times times(Expression left, Expression right) {
158: return new Times(left, right);
159: } // times
160:
161: public Xor xor(Expression left, Expression right) {
162: return new Xor(left, right);
163: } // xor
164: } // class DefaultExprFactory
|