Makefile.in: host_alias to host
[delight/core.git] / dmd2 / expression.h
blob461a72f2bb0adb686e394e0ed4a1fba574c41738
2 // Compiler implementation of the D programming language
3 // Copyright (c) 1999-2008 by Digital Mars
4 // All Rights Reserved
5 // written by Walter Bright
6 // http://www.digitalmars.com
7 // License for redistribution is by either the Artistic License
8 // in artistic.txt, or the GNU General Public License in gnu.txt.
9 // See the included readme.txt for details.
11 /* NOTE: This file has been patched from the original DMD distribution to
12 work with the GDC compiler.
14 Modified by David Friedman, September 2004
17 #ifndef DMD_EXPRESSION_H
18 #define DMD_EXPRESSION_H
20 #include "mars.h"
21 #include "identifier.h"
22 #include "lexer.h"
23 #include "arraytypes.h"
25 struct Type;
26 struct Scope;
27 struct TupleDeclaration;
28 struct VarDeclaration;
29 struct FuncDeclaration;
30 struct FuncLiteralDeclaration;
31 struct Declaration;
32 struct CtorDeclaration;
33 struct NewDeclaration;
34 struct Dsymbol;
35 struct Import;
36 struct Module;
37 struct ScopeDsymbol;
38 struct InlineCostState;
39 struct InlineDoState;
40 struct InlineScanState;
41 struct Expression;
42 struct Declaration;
43 struct AggregateDeclaration;
44 struct StructDeclaration;
45 struct TemplateInstance;
46 struct TemplateDeclaration;
47 struct ClassDeclaration;
48 struct HdrGenState;
49 struct BinExp;
50 struct InterState;
51 struct Symbol; // back end symbol
52 struct OverloadSet;
54 enum TOK;
56 // Back end
57 struct IRState;
58 struct dt_t;
60 #ifdef IN_GCC
61 union tree_node; typedef union tree_node elem;
62 #else
63 struct elem;
64 #endif
66 void initPrecedence();
68 Expression *resolveProperties(Scope *sc, Expression *e);
69 void accessCheck(Loc loc, Scope *sc, Expression *e, Declaration *d);
70 Expression *build_overload(Loc loc, Scope *sc, Expression *ethis, Expression *earg, Identifier *id);
71 Dsymbol *search_function(ScopeDsymbol *ad, Identifier *funcid);
72 void inferApplyArgTypes(enum TOK op, Arguments *arguments, Expression *aggr);
73 void argExpTypesToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *hgs);
74 void argsToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *hgs);
75 void expandTuples(Expressions *exps);
76 FuncDeclaration *hasThis(Scope *sc);
77 Expression *fromConstInitializer(int result, Expression *e);
78 int arrayExpressionCanThrow(Expressions *exps);
80 struct Expression : Object
82 Loc loc; // file location
83 enum TOK op; // handy to minimize use of dynamic_cast
84 Type *type; // !=NULL means that semantic() has been run
85 int size; // # of bytes in Expression so we can copy() it
87 Expression(Loc loc, enum TOK op, int size);
88 Expression *copy();
89 virtual Expression *syntaxCopy();
90 virtual Expression *semantic(Scope *sc);
92 int dyncast() { return DYNCAST_EXPRESSION; } // kludge for template.isExpression()
94 void print();
95 char *toChars();
96 virtual void dump(int indent);
97 void error(const char *format, ...);
98 virtual void rvalue();
100 static Expression *combine(Expression *e1, Expression *e2);
101 static Expressions *arraySyntaxCopy(Expressions *exps);
103 virtual integer_t toInteger();
104 virtual uinteger_t toUInteger();
105 virtual real_t toReal();
106 virtual real_t toImaginary();
107 virtual complex_t toComplex();
108 virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
109 virtual void toMangleBuffer(OutBuffer *buf);
110 virtual Expression *toLvalue(Scope *sc, Expression *e);
111 virtual Expression *modifiableLvalue(Scope *sc, Expression *e);
112 Expression *implicitCastTo(Scope *sc, Type *t);
113 virtual MATCH implicitConvTo(Type *t);
114 virtual Expression *castTo(Scope *sc, Type *t);
115 virtual void checkEscape();
116 void checkScalar();
117 void checkNoBool();
118 Expression *checkIntegral();
119 Expression *checkArithmetic();
120 void checkDeprecated(Scope *sc, Dsymbol *s);
121 virtual Expression *checkToBoolean();
122 Expression *checkToPointer();
123 Expression *addressOf(Scope *sc);
124 Expression *deref();
125 Expression *integralPromotions(Scope *sc);
127 Expression *toDelegate(Scope *sc, Type *t);
128 virtual void scanForNestedRef(Scope *sc);
130 virtual Expression *optimize(int result);
131 #define WANTflags 1
132 #define WANTvalue 2
133 #define WANTinterpret 4
135 virtual Expression *interpret(InterState *istate);
137 virtual int isConst();
138 virtual int isBool(int result);
139 virtual int isBit();
140 virtual int checkSideEffect(int flag);
141 virtual int canThrow();
143 virtual int inlineCost(InlineCostState *ics);
144 virtual Expression *doInline(InlineDoState *ids);
145 virtual Expression *inlineScan(InlineScanState *iss);
147 // For operator overloading
148 virtual int isCommutative();
149 virtual Identifier *opId();
150 virtual Identifier *opId_r();
152 // Back end
153 virtual elem *toElem(IRState *irs);
154 virtual dt_t **toDt(dt_t **pdt);
157 struct IntegerExp : Expression
159 integer_t value;
161 IntegerExp(Loc loc, integer_t value, Type *type);
162 IntegerExp(integer_t value);
163 int equals(Object *o);
164 Expression *semantic(Scope *sc);
165 Expression *interpret(InterState *istate);
166 char *toChars();
167 void dump(int indent);
168 integer_t toInteger();
169 real_t toReal();
170 real_t toImaginary();
171 complex_t toComplex();
172 int isConst();
173 int isBool(int result);
174 MATCH implicitConvTo(Type *t);
175 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
176 void toMangleBuffer(OutBuffer *buf);
177 Expression *toLvalue(Scope *sc, Expression *e);
178 elem *toElem(IRState *irs);
179 dt_t **toDt(dt_t **pdt);
182 struct RealExp : Expression
184 real_t value;
186 RealExp(Loc loc, real_t value, Type *type);
187 int equals(Object *o);
188 Expression *semantic(Scope *sc);
189 Expression *interpret(InterState *istate);
190 char *toChars();
191 integer_t toInteger();
192 uinteger_t toUInteger();
193 real_t toReal();
194 real_t toImaginary();
195 complex_t toComplex();
196 Expression *castTo(Scope *sc, Type *t);
197 int isConst();
198 int isBool(int result);
199 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
200 void toMangleBuffer(OutBuffer *buf);
201 elem *toElem(IRState *irs);
202 dt_t **toDt(dt_t **pdt);
205 struct ComplexExp : Expression
207 complex_t value;
209 ComplexExp(Loc loc, complex_t value, Type *type);
210 int equals(Object *o);
211 Expression *semantic(Scope *sc);
212 Expression *interpret(InterState *istate);
213 char *toChars();
214 integer_t toInteger();
215 uinteger_t toUInteger();
216 real_t toReal();
217 real_t toImaginary();
218 complex_t toComplex();
219 Expression *castTo(Scope *sc, Type *t);
220 int isConst();
221 int isBool(int result);
222 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
223 void toMangleBuffer(OutBuffer *buf);
224 #ifdef _DH
225 OutBuffer hexp;
226 #endif
227 elem *toElem(IRState *irs);
228 dt_t **toDt(dt_t **pdt);
231 struct IdentifierExp : Expression
233 Identifier *ident;
234 Declaration *var;
236 IdentifierExp(Loc loc, Identifier *ident);
237 IdentifierExp(Loc loc, Declaration *var);
238 Expression *semantic(Scope *sc);
239 char *toChars();
240 void dump(int indent);
241 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
242 Expression *toLvalue(Scope *sc, Expression *e);
245 struct DollarExp : IdentifierExp
247 DollarExp(Loc loc);
250 struct DsymbolExp : Expression
252 Dsymbol *s;
253 int hasOverloads;
255 DsymbolExp(Loc loc, Dsymbol *s, int hasOverloads = 0);
256 Expression *semantic(Scope *sc);
257 char *toChars();
258 void dump(int indent);
259 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
260 Expression *toLvalue(Scope *sc, Expression *e);
263 struct GetLoggerExp : Expression
265 GetLoggerExp(Loc loc);
266 Expression *semantic(Scope *sc);
267 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
268 //void scanForNestedRef(Scope *sc);
271 struct ThisExp : Expression
273 Declaration *var;
275 ThisExp(Loc loc);
276 Expression *semantic(Scope *sc);
277 int isBool(int result);
278 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
279 Expression *toLvalue(Scope *sc, Expression *e);
280 void scanForNestedRef(Scope *sc);
282 int inlineCost(InlineCostState *ics);
283 Expression *doInline(InlineDoState *ids);
284 //Expression *inlineScan(InlineScanState *iss);
286 elem *toElem(IRState *irs);
289 struct SuperExp : ThisExp
291 SuperExp(Loc loc);
292 Expression *semantic(Scope *sc);
293 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
294 void scanForNestedRef(Scope *sc);
296 int inlineCost(InlineCostState *ics);
297 Expression *doInline(InlineDoState *ids);
298 //Expression *inlineScan(InlineScanState *iss);
301 struct NullExp : Expression
303 unsigned char committed; // !=0 if type is committed
304 bool dUnchecked; // allow casting to non-null types (for D source)
306 NullExp(Loc loc);
307 Expression *semantic(Scope *sc);
308 int isBool(int result);
309 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
310 void toMangleBuffer(OutBuffer *buf);
311 MATCH implicitConvTo(Type *t);
312 Expression *castTo(Scope *sc, Type *t);
313 Expression *interpret(InterState *istate);
314 elem *toElem(IRState *irs);
315 dt_t **toDt(dt_t **pdt);
318 struct StringExp : Expression
320 void *string; // char, wchar, or dchar data
321 size_t len; // number of chars, wchars, or dchars
322 unsigned char sz; // 1: char, 2: wchar, 4: dchar
323 unsigned char committed; // !=0 if type is committed
324 unsigned char postfix; // 'c', 'w', 'd'
326 StringExp(Loc loc, char *s);
327 StringExp(Loc loc, void *s, size_t len);
328 StringExp(Loc loc, void *s, size_t len, unsigned char postfix);
329 //Expression *syntaxCopy();
330 int equals(Object *o);
331 char *toChars();
332 Expression *semantic(Scope *sc);
333 Expression *interpret(InterState *istate);
334 StringExp *toUTF8(Scope *sc);
335 MATCH implicitConvTo(Type *t);
336 Expression *castTo(Scope *sc, Type *t);
337 int compare(Object *obj);
338 int isBool(int result);
339 unsigned charAt(size_t i);
340 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
341 void toMangleBuffer(OutBuffer *buf);
342 elem *toElem(IRState *irs);
343 dt_t **toDt(dt_t **pdt);
346 // Tuple
348 struct TupleExp : Expression
350 Expressions *exps;
352 TupleExp(Loc loc, Expressions *exps);
353 TupleExp(Loc loc, TupleDeclaration *tup);
354 Expression *syntaxCopy();
355 int equals(Object *o);
356 Expression *semantic(Scope *sc);
357 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
358 void scanForNestedRef(Scope *sc);
359 void checkEscape();
360 int checkSideEffect(int flag);
361 Expression *optimize(int result);
362 Expression *interpret(InterState *istate);
363 Expression *castTo(Scope *sc, Type *t);
364 elem *toElem(IRState *irs);
365 int canThrow();
367 int inlineCost(InlineCostState *ics);
368 Expression *doInline(InlineDoState *ids);
369 Expression *inlineScan(InlineScanState *iss);
372 struct ArrayLiteralExp : Expression
374 Expressions *elements;
376 ArrayLiteralExp(Loc loc, Expressions *elements);
377 ArrayLiteralExp(Loc loc, Expression *e);
379 Expression *syntaxCopy();
380 Expression *semantic(Scope *sc);
381 int isBool(int result);
382 elem *toElem(IRState *irs);
383 int checkSideEffect(int flag);
384 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
385 void toMangleBuffer(OutBuffer *buf);
386 void scanForNestedRef(Scope *sc);
387 Expression *optimize(int result);
388 Expression *interpret(InterState *istate);
389 MATCH implicitConvTo(Type *t);
390 Expression *castTo(Scope *sc, Type *t);
391 dt_t **toDt(dt_t **pdt);
392 int canThrow();
394 int inlineCost(InlineCostState *ics);
395 Expression *doInline(InlineDoState *ids);
396 Expression *inlineScan(InlineScanState *iss);
399 struct AssocArrayLiteralExp : Expression
401 Expressions *keys;
402 Expressions *values;
404 AssocArrayLiteralExp(Loc loc, Expressions *keys, Expressions *values);
406 Expression *syntaxCopy();
407 Expression *semantic(Scope *sc);
408 int isBool(int result);
409 elem *toElem(IRState *irs);
410 int checkSideEffect(int flag);
411 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
412 void toMangleBuffer(OutBuffer *buf);
413 void scanForNestedRef(Scope *sc);
414 Expression *optimize(int result);
415 Expression *interpret(InterState *istate);
416 MATCH implicitConvTo(Type *t);
417 Expression *castTo(Scope *sc, Type *t);
418 int canThrow();
420 int inlineCost(InlineCostState *ics);
421 Expression *doInline(InlineDoState *ids);
422 Expression *inlineScan(InlineScanState *iss);
425 struct StructLiteralExp : Expression
427 StructDeclaration *sd; // which aggregate this is for
428 Expressions *elements; // parallels sd->fields[] with
429 // NULL entries for fields to skip
431 Symbol *sym; // back end symbol to initialize with literal
432 size_t soffset; // offset from start of s
433 int fillHoles; // fill alignment 'holes' with zero
435 StructLiteralExp(Loc loc, StructDeclaration *sd, Expressions *elements);
437 Expression *syntaxCopy();
438 Expression *semantic(Scope *sc);
439 Expression *getField(Type *type, unsigned offset);
440 int getFieldIndex(Type *type, unsigned offset);
441 elem *toElem(IRState *irs);
442 int checkSideEffect(int flag);
443 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
444 void toMangleBuffer(OutBuffer *buf);
445 void scanForNestedRef(Scope *sc);
446 Expression *optimize(int result);
447 Expression *interpret(InterState *istate);
448 dt_t **toDt(dt_t **pdt);
449 Expression *toLvalue(Scope *sc, Expression *e);
450 int canThrow();
451 MATCH implicitConvTo(Type *t);
453 int inlineCost(InlineCostState *ics);
454 Expression *doInline(InlineDoState *ids);
455 Expression *inlineScan(InlineScanState *iss);
458 struct TypeDotIdExp : Expression
460 Identifier *ident;
462 TypeDotIdExp(Loc loc, Type *type, Identifier *ident);
463 Expression *syntaxCopy();
464 Expression *semantic(Scope *sc);
465 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
466 elem *toElem(IRState *irs);
469 struct TypeExp : Expression
471 TypeExp(Loc loc, Type *type);
472 Expression *semantic(Scope *sc);
473 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
474 Expression *optimize(int result);
475 elem *toElem(IRState *irs);
478 struct ScopeExp : Expression
480 ScopeDsymbol *sds;
482 ScopeExp(Loc loc, ScopeDsymbol *sds);
483 Expression *syntaxCopy();
484 Expression *semantic(Scope *sc);
485 elem *toElem(IRState *irs);
486 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
489 struct TemplateExp : Expression
491 TemplateDeclaration *td;
493 TemplateExp(Loc loc, TemplateDeclaration *td);
494 void rvalue();
495 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
498 struct NewExp : Expression
500 /* thisexp.new(newargs) newtype(arguments)
502 Expression *thisexp; // if !NULL, 'this' for class being allocated
503 Expressions *newargs; // Array of Expression's to call new operator
504 Type *newtype;
505 Expressions *arguments; // Array of Expression's
507 CtorDeclaration *member; // constructor function
508 NewDeclaration *allocator; // allocator function
509 int onstack; // allocate on stack
511 NewExp(Loc loc, Expression *thisexp, Expressions *newargs,
512 Type *newtype, Expressions *arguments);
513 Expression *syntaxCopy();
514 Expression *semantic(Scope *sc);
515 elem *toElem(IRState *irs);
516 int checkSideEffect(int flag);
517 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
518 void scanForNestedRef(Scope *sc);
519 int canThrow();
521 //int inlineCost(InlineCostState *ics);
522 Expression *doInline(InlineDoState *ids);
523 //Expression *inlineScan(InlineScanState *iss);
526 struct NewAnonClassExp : Expression
528 /* thisexp.new(newargs) class baseclasses { } (arguments)
530 Expression *thisexp; // if !NULL, 'this' for class being allocated
531 Expressions *newargs; // Array of Expression's to call new operator
532 ClassDeclaration *cd; // class being instantiated
533 Expressions *arguments; // Array of Expression's to call class constructor
535 NewAnonClassExp(Loc loc, Expression *thisexp, Expressions *newargs,
536 ClassDeclaration *cd, Expressions *arguments);
537 Expression *syntaxCopy();
538 Expression *semantic(Scope *sc);
539 int checkSideEffect(int flag);
540 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
541 int canThrow();
544 struct SymbolExp : Expression
546 Declaration *var;
547 int hasOverloads;
549 SymbolExp(Loc loc, enum TOK op, int size, Declaration *var, int hasOverloads);
551 elem *toElem(IRState *irs);
554 // Offset from symbol
556 struct SymOffExp : SymbolExp
558 target_size_t offset;
560 SymOffExp(Loc loc, Declaration *var, target_size_t offset, int hasOverloads = 0);
561 Expression *semantic(Scope *sc);
562 void checkEscape();
563 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
564 int isConst();
565 int isBool(int result);
566 Expression *doInline(InlineDoState *ids);
567 MATCH implicitConvTo(Type *t);
568 Expression *castTo(Scope *sc, Type *t);
569 void scanForNestedRef(Scope *sc);
571 dt_t **toDt(dt_t **pdt);
574 // Variable
576 struct VarExp : SymbolExp
578 VarExp(Loc loc, Declaration *var, int hasOverloads = 0);
579 int equals(Object *o);
580 Expression *semantic(Scope *sc);
581 Expression *optimize(int result);
582 Expression *interpret(InterState *istate);
583 void dump(int indent);
584 char *toChars();
585 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
586 void checkEscape();
587 Expression *toLvalue(Scope *sc, Expression *e);
588 Expression *modifiableLvalue(Scope *sc, Expression *e);
589 dt_t **toDt(dt_t **pdt);
590 void scanForNestedRef(Scope *sc);
592 int inlineCost(InlineCostState *ics);
593 Expression *doInline(InlineDoState *ids);
594 //Expression *inlineScan(InlineScanState *iss);
597 // Overload Set
599 struct OverExp : Expression
601 OverloadSet *vars;
603 OverExp(OverloadSet *s);
604 Expression *toLvalue(Scope *sc, Expression *e);
608 // Function/Delegate literal
610 struct FuncExp : Expression
612 FuncLiteralDeclaration *fd;
614 FuncExp(Loc loc, FuncLiteralDeclaration *fd);
615 Expression *syntaxCopy();
616 Expression *semantic(Scope *sc);
617 void scanForNestedRef(Scope *sc);
618 char *toChars();
619 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
620 elem *toElem(IRState *irs);
622 int inlineCost(InlineCostState *ics);
623 //Expression *doInline(InlineDoState *ids);
624 //Expression *inlineScan(InlineScanState *iss);
627 // Declaration of a symbol
629 struct DeclarationExp : Expression
631 Dsymbol *declaration;
633 DeclarationExp(Loc loc, Dsymbol *declaration);
634 Expression *syntaxCopy();
635 Expression *semantic(Scope *sc);
636 Expression *interpret(InterState *istate);
637 int checkSideEffect(int flag);
638 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
639 elem *toElem(IRState *irs);
640 void scanForNestedRef(Scope *sc);
641 int canThrow();
643 int inlineCost(InlineCostState *ics);
644 Expression *doInline(InlineDoState *ids);
645 Expression *inlineScan(InlineScanState *iss);
648 struct TypeidExp : Expression
650 Type *typeidType;
652 TypeidExp(Loc loc, Type *typeidType);
653 Expression *syntaxCopy();
654 Expression *semantic(Scope *sc);
655 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
658 struct TraitsExp : Expression
660 Identifier *ident;
661 Objects *args;
663 TraitsExp(Loc loc, Identifier *ident, Objects *args);
664 Expression *syntaxCopy();
665 Expression *semantic(Scope *sc);
666 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
669 struct HaltExp : Expression
671 HaltExp(Loc loc);
672 Expression *semantic(Scope *sc);
673 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
674 int checkSideEffect(int flag);
676 elem *toElem(IRState *irs);
679 struct IsExp : Expression
681 /* is(targ id tok tspec)
682 * is(targ id == tok2)
684 Type *targ;
685 Identifier *id; // can be NULL
686 enum TOK tok; // ':' or '=='
687 Type *tspec; // can be NULL
688 enum TOK tok2; // 'struct', 'union', 'typedef', etc.
689 TemplateParameters *parameters;
691 IsExp(Loc loc, Type *targ, Identifier *id, enum TOK tok, Type *tspec,
692 enum TOK tok2, TemplateParameters *parameters);
693 Expression *syntaxCopy();
694 Expression *semantic(Scope *sc);
695 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
698 /****************************************************************/
700 struct UnaExp : Expression
702 Expression *e1;
704 UnaExp(Loc loc, enum TOK op, int size, Expression *e1);
705 Expression *syntaxCopy();
706 Expression *semantic(Scope *sc);
707 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
708 Expression *optimize(int result);
709 void dump(int indent);
710 void scanForNestedRef(Scope *sc);
711 Expression *interpretCommon(InterState *istate, Expression *(*fp)(Type *, Expression *));
712 int canThrow();
714 int inlineCost(InlineCostState *ics);
715 Expression *doInline(InlineDoState *ids);
716 Expression *inlineScan(InlineScanState *iss);
718 Expression *op_overload(Scope *sc); // doesn't need to be virtual
721 struct BinExp : Expression
723 Expression *e1;
724 Expression *e2;
726 BinExp(Loc loc, enum TOK op, int size, Expression *e1, Expression *e2);
727 Expression *syntaxCopy();
728 Expression *semantic(Scope *sc);
729 Expression *semanticp(Scope *sc);
730 Expression *commonSemanticAssign(Scope *sc);
731 Expression *commonSemanticAssignIntegral(Scope *sc);
732 int checkSideEffect(int flag);
733 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
734 Expression *scaleFactor(Scope *sc);
735 Expression *typeCombine(Scope *sc);
736 Expression *optimize(int result);
737 int isunsigned();
738 void incompatibleTypes();
739 void dump(int indent);
740 void scanForNestedRef(Scope *sc);
741 Expression *interpretCommon(InterState *istate, Expression *(*fp)(Type *, Expression *, Expression *));
742 Expression *interpretCommon2(InterState *istate, Expression *(*fp)(TOK, Type *, Expression *, Expression *));
743 Expression *interpretAssignCommon(InterState *istate, Expression *(*fp)(Type *, Expression *, Expression *), int post = 0);
744 int canThrow();
746 int inlineCost(InlineCostState *ics);
747 Expression *doInline(InlineDoState *ids);
748 Expression *inlineScan(InlineScanState *iss);
750 Expression *op_overload(Scope *sc);
752 elem *toElemBin(IRState *irs, int op);
755 struct BinAssignExp : BinExp
757 BinAssignExp(Loc loc, enum TOK op, int size, Expression *e1, Expression *e2);
758 int checkSideEffect(int flag);
761 /****************************************************************/
763 struct CompileExp : UnaExp
765 CompileExp(Loc loc, Expression *e);
766 Expression *semantic(Scope *sc);
767 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
770 struct FileExp : UnaExp
772 FileExp(Loc loc, Expression *e);
773 Expression *semantic(Scope *sc);
774 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
777 struct AssertExp : UnaExp
779 Expression *msg;
781 AssertExp(Loc loc, Expression *e, Expression *msg = NULL);
782 Expression *syntaxCopy();
783 Expression *semantic(Scope *sc);
784 Expression *interpret(InterState *istate);
785 int checkSideEffect(int flag);
786 int canThrow();
787 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
789 int inlineCost(InlineCostState *ics);
790 Expression *doInline(InlineDoState *ids);
791 Expression *inlineScan(InlineScanState *iss);
793 elem *toElem(IRState *irs);
796 struct DotIdExp : UnaExp
798 Identifier *ident;
800 DotIdExp(Loc loc, Expression *e, Identifier *ident);
801 Expression *semantic(Scope *sc);
802 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
803 void dump(int i);
806 struct DotTemplateExp : UnaExp
808 TemplateDeclaration *td;
810 DotTemplateExp(Loc loc, Expression *e, TemplateDeclaration *td);
811 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
814 struct DotVarExp : UnaExp
816 Declaration *var;
817 int hasOverloads;
819 DotVarExp(Loc loc, Expression *e, Declaration *var, int hasOverloads = 0);
820 Expression *semantic(Scope *sc);
821 Expression *toLvalue(Scope *sc, Expression *e);
822 Expression *modifiableLvalue(Scope *sc, Expression *e);
823 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
824 void dump(int indent);
825 elem *toElem(IRState *irs);
828 struct DotTemplateInstanceExp : UnaExp
830 TemplateInstance *ti;
832 DotTemplateInstanceExp(Loc loc, Expression *e, TemplateInstance *ti);
833 Expression *syntaxCopy();
834 Expression *semantic(Scope *sc);
835 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
836 void dump(int indent);
839 struct DelegateExp : UnaExp
841 FuncDeclaration *func;
842 int hasOverloads;
844 DelegateExp(Loc loc, Expression *e, FuncDeclaration *func, int hasOverloads = 0);
845 Expression *semantic(Scope *sc);
846 MATCH implicitConvTo(Type *t);
847 Expression *castTo(Scope *sc, Type *t);
848 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
849 void dump(int indent);
851 int inlineCost(InlineCostState *ics);
852 elem *toElem(IRState *irs);
855 struct DotTypeExp : UnaExp
857 Dsymbol *sym; // symbol that represents a type
859 DotTypeExp(Loc loc, Expression *e, Dsymbol *sym);
860 Expression *semantic(Scope *sc);
861 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
862 elem *toElem(IRState *irs);
865 struct CallExp : UnaExp
867 Expressions *arguments; // function arguments
869 CallExp(Loc loc, Expression *e, Expressions *exps);
870 CallExp(Loc loc, Expression *e);
871 CallExp(Loc loc, Expression *e, Expression *earg1);
872 CallExp(Loc loc, Expression *e, Expression *earg1, Expression *earg2);
874 Expression *syntaxCopy();
875 Expression *semantic(Scope *sc);
876 Expression *optimize(int result);
877 Expression *interpret(InterState *istate);
878 int checkSideEffect(int flag);
879 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
880 void dump(int indent);
881 elem *toElem(IRState *irs);
882 void scanForNestedRef(Scope *sc);
883 Expression *toLvalue(Scope *sc, Expression *e);
884 int canThrow();
886 int inlineCost(InlineCostState *ics);
887 Expression *doInline(InlineDoState *ids);
888 Expression *inlineScan(InlineScanState *iss);
891 struct AddrExp : UnaExp
893 AddrExp(Loc loc, Expression *e);
894 Expression *semantic(Scope *sc);
895 elem *toElem(IRState *irs);
896 MATCH implicitConvTo(Type *t);
897 Expression *castTo(Scope *sc, Type *t);
898 Expression *optimize(int result);
901 struct PtrExp : UnaExp
903 PtrExp(Loc loc, Expression *e);
904 PtrExp(Loc loc, Expression *e, Type *t);
905 Expression *semantic(Scope *sc);
906 Expression *toLvalue(Scope *sc, Expression *e);
907 Expression *modifiableLvalue(Scope *sc, Expression *e);
908 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
909 elem *toElem(IRState *irs);
910 Expression *optimize(int result);
911 Expression *interpret(InterState *istate);
913 // For operator overloading
914 Identifier *opId();
917 struct NegExp : UnaExp
919 NegExp(Loc loc, Expression *e);
920 Expression *semantic(Scope *sc);
921 Expression *optimize(int result);
922 Expression *interpret(InterState *istate);
924 // For operator overloading
925 Identifier *opId();
927 elem *toElem(IRState *irs);
930 struct UAddExp : UnaExp
932 UAddExp(Loc loc, Expression *e);
933 Expression *semantic(Scope *sc);
935 // For operator overloading
936 Identifier *opId();
939 struct ComExp : UnaExp
941 ComExp(Loc loc, Expression *e);
942 Expression *semantic(Scope *sc);
943 Expression *optimize(int result);
944 Expression *interpret(InterState *istate);
946 // For operator overloading
947 Identifier *opId();
949 elem *toElem(IRState *irs);
952 struct NotExp : UnaExp
954 NotExp(Loc loc, Expression *e);
955 Expression *semantic(Scope *sc);
956 Expression *optimize(int result);
957 Expression *interpret(InterState *istate);
958 int isBit();
959 elem *toElem(IRState *irs);
962 struct BoolExp : UnaExp
964 BoolExp(Loc loc, Expression *e, Type *type);
965 Expression *semantic(Scope *sc);
966 Expression *optimize(int result);
967 Expression *interpret(InterState *istate);
968 int isBit();
969 elem *toElem(IRState *irs);
972 struct DeleteExp : UnaExp
974 DeleteExp(Loc loc, Expression *e);
975 Expression *semantic(Scope *sc);
976 Expression *checkToBoolean();
977 int checkSideEffect(int flag);
978 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
979 elem *toElem(IRState *irs);
982 struct CastExp : UnaExp
984 // Possible to cast to one type while painting to another type
985 Type *to; // type to cast to
986 enum TOK tok; // TOKconst or TOKinvariant
988 CastExp(Loc loc, Expression *e, Type *t);
989 CastExp(Loc loc, Expression *e, enum TOK tok);
990 Expression *syntaxCopy();
991 Expression *semantic(Scope *sc);
992 Expression *optimize(int result);
993 Expression *interpret(InterState *istate);
994 int checkSideEffect(int flag);
995 void checkEscape();
996 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
997 elem *toElem(IRState *irs);
999 // For operator overloading
1000 Identifier *opId();
1004 struct SliceExp : UnaExp
1006 Expression *upr; // NULL if implicit 0
1007 Expression *lwr; // NULL if implicit [length - 1]
1008 VarDeclaration *lengthVar;
1010 SliceExp(Loc loc, Expression *e1, Expression *lwr, Expression *upr);
1011 Expression *syntaxCopy();
1012 Expression *semantic(Scope *sc);
1013 void checkEscape();
1014 Expression *toLvalue(Scope *sc, Expression *e);
1015 Expression *modifiableLvalue(Scope *sc, Expression *e);
1016 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1017 Expression *optimize(int result);
1018 Expression *interpret(InterState *istate);
1019 void dump(int indent);
1020 elem *toElem(IRState *irs);
1021 void scanForNestedRef(Scope *sc);
1023 int inlineCost(InlineCostState *ics);
1024 Expression *doInline(InlineDoState *ids);
1025 Expression *inlineScan(InlineScanState *iss);
1028 struct ArrayLengthExp : UnaExp
1030 ArrayLengthExp(Loc loc, Expression *e1);
1031 Expression *semantic(Scope *sc);
1032 Expression *optimize(int result);
1033 Expression *interpret(InterState *istate);
1034 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1035 elem *toElem(IRState *irs);
1038 // e1[a0,a1,a2,a3,...]
1040 struct ArrayExp : UnaExp
1042 Expressions *arguments; // Array of Expression's
1044 ArrayExp(Loc loc, Expression *e1, Expressions *arguments);
1045 Expression *syntaxCopy();
1046 Expression *semantic(Scope *sc);
1047 Expression *toLvalue(Scope *sc, Expression *e);
1048 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1049 void scanForNestedRef(Scope *sc);
1051 // For operator overloading
1052 Identifier *opId();
1054 int inlineCost(InlineCostState *ics);
1055 Expression *doInline(InlineDoState *ids);
1056 Expression *inlineScan(InlineScanState *iss);
1059 /****************************************************************/
1061 struct DotExp : BinExp
1063 DotExp(Loc loc, Expression *e1, Expression *e2);
1064 Expression *semantic(Scope *sc);
1067 struct CommaExp : BinExp
1069 CommaExp(Loc loc, Expression *e1, Expression *e2);
1070 Expression *semantic(Scope *sc);
1071 void checkEscape();
1072 Expression *toLvalue(Scope *sc, Expression *e);
1073 Expression *modifiableLvalue(Scope *sc, Expression *e);
1074 int isBool(int result);
1075 int checkSideEffect(int flag);
1076 Expression *optimize(int result);
1077 Expression *interpret(InterState *istate);
1078 elem *toElem(IRState *irs);
1081 struct IndexExp : BinExp
1083 VarDeclaration *lengthVar;
1084 int modifiable;
1086 IndexExp(Loc loc, Expression *e1, Expression *e2);
1087 Expression *semantic(Scope *sc);
1088 Expression *toLvalue(Scope *sc, Expression *e);
1089 Expression *modifiableLvalue(Scope *sc, Expression *e);
1090 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1091 Expression *optimize(int result);
1092 Expression *interpret(InterState *istate);
1093 Expression *doInline(InlineDoState *ids);
1094 void scanForNestedRef(Scope *sc);
1096 elem *toElem(IRState *irs);
1099 /* For both i++ and i--
1101 struct PostExp : BinExp
1103 PostExp(enum TOK op, Loc loc, Expression *e);
1104 Expression *semantic(Scope *sc);
1105 Expression *interpret(InterState *istate);
1106 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1107 Identifier *opId(); // For operator overloading
1108 elem *toElem(IRState *irs);
1111 struct AssignExp : BinExp
1112 { int ismemset; // !=0 if setting the contents of an array
1114 AssignExp(Loc loc, Expression *e1, Expression *e2);
1115 Expression *semantic(Scope *sc);
1116 Expression *checkToBoolean();
1117 Expression *interpret(InterState *istate);
1118 Identifier *opId(); // For operator overloading
1119 elem *toElem(IRState *irs);
1122 #define ASSIGNEXP(op) \
1123 struct op##AssignExp : BinExp \
1125 op##AssignExp(Loc loc, Expression *e1, Expression *e2); \
1126 Expression *semantic(Scope *sc); \
1127 Expression *interpret(InterState *istate); \
1129 Identifier *opId(); /* For operator overloading */ \
1131 elem *toElem(IRState *irs); \
1134 ASSIGNEXP(Add)
1135 ASSIGNEXP(Min)
1136 ASSIGNEXP(Cat)
1137 ASSIGNEXP(Mul)
1138 ASSIGNEXP(Div)
1139 ASSIGNEXP(Mod)
1140 ASSIGNEXP(Shl)
1141 ASSIGNEXP(Shr)
1142 ASSIGNEXP(Ushr)
1143 ASSIGNEXP(And)
1144 ASSIGNEXP(Or)
1145 ASSIGNEXP(Xor)
1147 #undef ASSIGNEXP
1149 struct AddExp : BinExp
1151 AddExp(Loc loc, Expression *e1, Expression *e2);
1152 Expression *semantic(Scope *sc);
1153 Expression *optimize(int result);
1154 Expression *interpret(InterState *istate);
1156 // For operator overloading
1157 int isCommutative();
1158 Identifier *opId();
1159 Identifier *opId_r();
1161 elem *toElem(IRState *irs);
1164 struct MinExp : BinExp
1166 MinExp(Loc loc, Expression *e1, Expression *e2);
1167 Expression *semantic(Scope *sc);
1168 Expression *optimize(int result);
1169 Expression *interpret(InterState *istate);
1171 // For operator overloading
1172 Identifier *opId();
1173 Identifier *opId_r();
1175 elem *toElem(IRState *irs);
1178 struct CatExp : BinExp
1180 CatExp(Loc loc, Expression *e1, Expression *e2);
1181 Expression *semantic(Scope *sc);
1182 Expression *optimize(int result);
1183 Expression *interpret(InterState *istate);
1185 // For operator overloading
1186 Identifier *opId();
1187 Identifier *opId_r();
1189 elem *toElem(IRState *irs);
1192 struct MulExp : BinExp
1194 MulExp(Loc loc, Expression *e1, Expression *e2);
1195 Expression *semantic(Scope *sc);
1196 Expression *optimize(int result);
1197 Expression *interpret(InterState *istate);
1199 // For operator overloading
1200 int isCommutative();
1201 Identifier *opId();
1202 Identifier *opId_r();
1204 elem *toElem(IRState *irs);
1207 struct DivExp : BinExp
1209 DivExp(Loc loc, Expression *e1, Expression *e2);
1210 Expression *semantic(Scope *sc);
1211 Expression *optimize(int result);
1212 Expression *interpret(InterState *istate);
1214 // For operator overloading
1215 Identifier *opId();
1216 Identifier *opId_r();
1218 elem *toElem(IRState *irs);
1221 struct ModExp : BinExp
1223 ModExp(Loc loc, Expression *e1, Expression *e2);
1224 Expression *semantic(Scope *sc);
1225 Expression *optimize(int result);
1226 Expression *interpret(InterState *istate);
1228 // For operator overloading
1229 Identifier *opId();
1230 Identifier *opId_r();
1232 elem *toElem(IRState *irs);
1235 struct ShlExp : BinExp
1237 ShlExp(Loc loc, Expression *e1, Expression *e2);
1238 Expression *semantic(Scope *sc);
1239 Expression *optimize(int result);
1240 Expression *interpret(InterState *istate);
1242 // For operator overloading
1243 Identifier *opId();
1244 Identifier *opId_r();
1246 elem *toElem(IRState *irs);
1249 struct ShrExp : BinExp
1251 ShrExp(Loc loc, Expression *e1, Expression *e2);
1252 Expression *semantic(Scope *sc);
1253 Expression *optimize(int result);
1254 Expression *interpret(InterState *istate);
1256 // For operator overloading
1257 Identifier *opId();
1258 Identifier *opId_r();
1260 elem *toElem(IRState *irs);
1263 struct UshrExp : BinExp
1265 UshrExp(Loc loc, Expression *e1, Expression *e2);
1266 Expression *semantic(Scope *sc);
1267 Expression *optimize(int result);
1268 Expression *interpret(InterState *istate);
1270 // For operator overloading
1271 Identifier *opId();
1272 Identifier *opId_r();
1274 elem *toElem(IRState *irs);
1277 struct AndExp : BinExp
1279 AndExp(Loc loc, Expression *e1, Expression *e2);
1280 Expression *semantic(Scope *sc);
1281 Expression *optimize(int result);
1282 Expression *interpret(InterState *istate);
1284 // For operator overloading
1285 int isCommutative();
1286 Identifier *opId();
1287 Identifier *opId_r();
1289 elem *toElem(IRState *irs);
1292 struct OrExp : BinExp
1294 OrExp(Loc loc, Expression *e1, Expression *e2);
1295 Expression *semantic(Scope *sc);
1296 Expression *optimize(int result);
1297 Expression *interpret(InterState *istate);
1299 // For operator overloading
1300 int isCommutative();
1301 Identifier *opId();
1302 Identifier *opId_r();
1304 elem *toElem(IRState *irs);
1307 struct XorExp : BinExp
1309 XorExp(Loc loc, Expression *e1, Expression *e2);
1310 Expression *semantic(Scope *sc);
1311 Expression *optimize(int result);
1312 Expression *interpret(InterState *istate);
1314 // For operator overloading
1315 int isCommutative();
1316 Identifier *opId();
1317 Identifier *opId_r();
1319 elem *toElem(IRState *irs);
1322 struct OrOrExp : BinExp
1324 OrOrExp(Loc loc, Expression *e1, Expression *e2);
1325 Expression *semantic(Scope *sc);
1326 Expression *checkToBoolean();
1327 int isBit();
1328 Expression *optimize(int result);
1329 Expression *interpret(InterState *istate);
1330 int checkSideEffect(int flag);
1331 elem *toElem(IRState *irs);
1334 struct AndAndExp : BinExp
1336 AndAndExp(Loc loc, Expression *e1, Expression *e2);
1337 Expression *semantic(Scope *sc);
1338 Expression *checkToBoolean();
1339 int isBit();
1340 Expression *optimize(int result);
1341 Expression *interpret(InterState *istate);
1342 int checkSideEffect(int flag);
1343 elem *toElem(IRState *irs);
1346 struct CmpExp : BinExp
1348 CmpExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
1349 Expression *semantic(Scope *sc);
1350 Expression *optimize(int result);
1351 Expression *interpret(InterState *istate);
1352 int isBit();
1354 // For operator overloading
1355 int isCommutative();
1356 Identifier *opId();
1358 elem *toElem(IRState *irs);
1361 struct InExp : BinExp
1363 InExp(Loc loc, Expression *e1, Expression *e2);
1364 Expression *semantic(Scope *sc);
1365 int isBit();
1367 // For operator overloading
1368 Identifier *opId();
1369 Identifier *opId_r();
1371 elem *toElem(IRState *irs);
1374 struct RemoveExp : BinExp
1376 RemoveExp(Loc loc, Expression *e1, Expression *e2);
1377 elem *toElem(IRState *irs);
1380 // == and !=
1382 struct EqualExp : BinExp
1384 EqualExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
1385 Expression *semantic(Scope *sc);
1386 Expression *optimize(int result);
1387 Expression *interpret(InterState *istate);
1388 int isBit();
1390 // For operator overloading
1391 int isCommutative();
1392 Identifier *opId();
1394 elem *toElem(IRState *irs);
1397 // === and !===
1399 struct IdentityExp : BinExp
1401 IdentityExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
1402 Expression *semantic(Scope *sc);
1403 int isBit();
1404 Expression *optimize(int result);
1405 Expression *interpret(InterState *istate);
1406 elem *toElem(IRState *irs);
1409 /****************************************************************/
1411 struct CondExp : BinExp
1413 Expression *econd;
1415 CondExp(Loc loc, Expression *econd, Expression *e1, Expression *e2);
1416 Expression *syntaxCopy();
1417 Expression *semantic(Scope *sc);
1418 Expression *optimize(int result);
1419 Expression *interpret(InterState *istate);
1420 void checkEscape();
1421 Expression *toLvalue(Scope *sc, Expression *e);
1422 Expression *modifiableLvalue(Scope *sc, Expression *e);
1423 Expression *checkToBoolean();
1424 int checkSideEffect(int flag);
1425 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1426 MATCH implicitConvTo(Type *t);
1427 Expression *castTo(Scope *sc, Type *t);
1428 void scanForNestedRef(Scope *sc);
1429 int canThrow();
1431 int inlineCost(InlineCostState *ics);
1432 Expression *doInline(InlineDoState *ids);
1433 Expression *inlineScan(InlineScanState *iss);
1435 elem *toElem(IRState *irs);
1439 /****************************************************************/
1441 struct DefaultInitExp : Expression
1443 enum TOK subop; // which of the derived classes this is
1445 DefaultInitExp(Loc loc, enum TOK subop, int size);
1446 virtual Expression *resolve(Loc loc, Scope *sc) = 0;
1447 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1450 struct FileInitExp : DefaultInitExp
1452 FileInitExp(Loc loc);
1453 Expression *semantic(Scope *sc);
1454 Expression *resolve(Loc loc, Scope *sc);
1457 struct LineInitExp : DefaultInitExp
1459 LineInitExp(Loc loc);
1460 Expression *semantic(Scope *sc);
1461 Expression *resolve(Loc loc, Scope *sc);
1464 /****************************************************************/
1466 /* Special values used by the interpreter
1468 #define EXP_CANT_INTERPRET ((Expression *)1)
1469 #define EXP_CONTINUE_INTERPRET ((Expression *)2)
1470 #define EXP_BREAK_INTERPRET ((Expression *)3)
1471 #define EXP_GOTO_INTERPRET ((Expression *)4)
1472 #define EXP_VOID_INTERPRET ((Expression *)5)
1474 Expression *expType(Type *type, Expression *e);
1476 Expression *Neg(Type *type, Expression *e1);
1477 Expression *Com(Type *type, Expression *e1);
1478 Expression *Not(Type *type, Expression *e1);
1479 Expression *Bool(Type *type, Expression *e1);
1480 Expression *Cast(Type *type, Type *to, Expression *e1);
1481 Expression *ArrayLength(Type *type, Expression *e1);
1482 Expression *Ptr(Type *type, Expression *e1);
1484 Expression *Add(Type *type, Expression *e1, Expression *e2);
1485 Expression *Min(Type *type, Expression *e1, Expression *e2);
1486 Expression *Mul(Type *type, Expression *e1, Expression *e2);
1487 Expression *Div(Type *type, Expression *e1, Expression *e2);
1488 Expression *Mod(Type *type, Expression *e1, Expression *e2);
1489 Expression *Shl(Type *type, Expression *e1, Expression *e2);
1490 Expression *Shr(Type *type, Expression *e1, Expression *e2);
1491 Expression *Ushr(Type *type, Expression *e1, Expression *e2);
1492 Expression *And(Type *type, Expression *e1, Expression *e2);
1493 Expression *Or(Type *type, Expression *e1, Expression *e2);
1494 Expression *Xor(Type *type, Expression *e1, Expression *e2);
1495 Expression *Index(Type *type, Expression *e1, Expression *e2);
1496 Expression *Cat(Type *type, Expression *e1, Expression *e2);
1498 Expression *Equal(enum TOK op, Type *type, Expression *e1, Expression *e2);
1499 Expression *Cmp(enum TOK op, Type *type, Expression *e1, Expression *e2);
1500 Expression *Identity(enum TOK op, Type *type, Expression *e1, Expression *e2);
1502 Expression *Slice(Type *type, Expression *e1, Expression *lwr, Expression *upr);
1504 #endif /* DMD_EXPRESSION_H */