Home | History | Annotate | Download | only in dmd

Lines Matching refs:AST

33 class Parser(AST, Lexer = dmd.lexer.Lexer) : Lexer
35 AST.ModuleDeclaration* md;
39 AST.Module mod;
53 extern (D) this(const ref Loc loc, AST.Module _module, const(char)[] input, bool doDocComment)
75 extern (D) this(AST.Module _module, const(char)[] input, bool doDocComment)
92 AST.Dsymbols* parseModule()
109 AST.Expression msg = null;
145 md = new AST.ModuleDeclaration(loc, a, id, msg, isdeprecated);
160 final AST.Dsymbols* parseModuleContent()
162 AST.Dsymbol lastDecl = mod;
163 AST.Dsymbols* decldefs = parseDeclDefs(0, &lastDecl);
184 private AST.Dsymbols* errorReturn()
189 return new AST.Dsymbols();
202 void parseModuleAttributes(out AST.Expression msg, out bool isdeprecated)
208 AST.Expressions* udas = null;
230 AST.Expressions* exps = null;
238 udas = AST.UserAttributeDeclaration.concat(udas, exps);
255 auto a = new AST.Dsymbols();
256 auto udad = new AST.UserAttributeDeclaration(udas, a);
275 private bool parseDeprecatedAttribute(ref AST.Expression msg)
282 AST.Expression e = parseAssignExp();
292 AST.Dsymbols* parseDeclDefs(int once, AST.Dsymbol* pLastDecl = null, PrefixAttributes!AST* pAttrs = null)
294 AST.Dsymbol lastDecl = null; // used to link unittest to its previous declaration
301 auto decldefs = new AST.Dsymbols();
305 AST.Dsymbol s = null;
306 AST.Dsymbols* a = null;
308 PrefixAttributes!AST attrs;
314 AST.Visibility.Kind prot;
316 AST.Condition condition;
350 s = cast(AST.Dsymbol)parseTemplateDeclaration();
367 s = new AST.CompileDeclaration(loc, exps);
373 s = cast(AST.Dsymbol)parseTemplateDeclaration(true);
487 (*pLastDecl).ddocUnittest = cast(AST.UnitTestDeclaration)s;
521 s = new AST.UnitTestDeclaration(loc, token.loc, STC.undefined_, null);
553 AST.Dsymbols* athen;
563 AST.Dsymbols* aelse = null;
571 s = new AST.StaticIfDeclaration(loc, condition, athen, aelse);
580 s = parseForeach!(AST.StaticForeachDeclaration)(token.loc, pLastDecl);
671 AST.Expressions* exps = null;
676 pAttrs.udas = AST.UserAttributeDeclaration.concat(pAttrs.udas, exps);
691 a = parseAutoDeclarations(getStorageClass!AST(pAttrs), pAttrs.comment);
696 s = new AST.UserAttributeDeclaration(pAttrs.udas, a);
723 s = new AST.UserAttributeDeclaration(pAttrs.udas, a);
730 auto stc2 = getStorageClass!AST(pAttrs);
733 s = new AST.StorageClassDeclaration(stc2, a);
739 a = new AST.Dsymbols();
742 s = new AST.UserAttributeDeclaration(pAttrs.udas, a);
754 s = new AST.DeprecatedDeclaration(pAttrs.depmsg, a);
763 AST.Expressions* exps = parseArguments();
766 pAttrs.udas = AST.UserAttributeDeclaration.concat(pAttrs.udas, exps);
770 s = new AST.UserAttributeDeclaration(pAttrs.udas, a);
789 error("conflicting linkage `extern (%s)` and `extern (%s)`", AST.linkageToChars(pAttrs.link), AST.linkageToChars(res.link));
802 error("redundant linkage `extern (%s)`", AST.linkageToChars(pAttrs.link));
817 a = new AST.Dsymbols();
820 s = new AST.Nspace(linkLoc, id, null, a);
830 AST.Expression exp = (*res.identExps)[--i];
833 a = new AST.Dsymbols();
836 s = new AST.CPPNamespaceDeclaration(linkLoc, exp, a);
843 s = new AST.CPPMangleDeclaration(linkLoc, res.cppmangle, a);
847 s = new AST.LinkDeclaration(linkLoc, pAttrs.link, a);
854 prot = AST.Visibility.Kind.private_;
858 prot = AST.Visibility.Kind.package_;
862 prot = AST.Visibility.Kind.protected_;
866 prot = AST.Visibility.Kind.public_;
870 prot = AST.Visibility.Kind.export_;
874 if (pAttrs.visibility.kind != AST.Visibility.Kind.undefined)
877 error("conflicting visibility attribute `%s` and `%s`", AST.visibilityToChars(pAttrs.visibility.kind), AST.visibilityToChars(prot));
879 error("redundant visibility attribute `%s`", AST.visibilityToChars(prot));
888 AST.Visibility.Kind.package_ && token.value == TOK.leftParenthesis)
904 if (pAttrs.visibility.kind != AST.Visibility.Kind.undefined)
906 if (pAttrs.visibility.kind == AST.Visibility.Kind.package_ && pkg_prot_idents)
907 s = new AST.VisibilityDeclaration(attrloc, pkg_prot_idents, a);
909 s = new AST.VisibilityDeclaration(attrloc, pAttrs.visibility, a);
911 pAttrs.visibility = AST.Visibility(AST.Visibility.Kind.undefined);
921 AST.Expression e = null; // default
942 s = new AST.AlignDeclaration(attrLoc, pAttrs.ealign, a);
950 AST.Expressions* args = null;
967 AST.Dsymbols* a2 = null;
982 s = new AST.PragmaDeclaration(loc, ident, args, a2);
1009 AST.Dsymbols* athen;
1019 AST.Dsymbols* aelse = null;
1027 s = new AST.ConditionalDeclaration(startloc, condition, athen, aelse);
1072 private AST.Dsymbols* parseAutoDeclarations(StorageClass storageClass, const(char)* comment)
1075 auto a = new AST.Dsymbols();
1083 AST.TemplateParameters* tpl = null;
1088 AST.Initializer _init = parseInitializer();
1089 auto v = new AST.VarDeclaration(loc, null, ident, _init, storageClass);
1091 AST.Dsymbol s = v;
1094 auto a2 = new AST.Dsymbols();
1096 auto tempdecl = new AST.TemplateDeclaration(loc, ident, tpl, null, a2, 0);
1129 private AST.Dsymbols* parseBlock(AST.Dsymbol* pLastDecl, PrefixAttributes!AST* pAttrs = null)
1131 AST.Dsymbols* a = null;
1199 AST.stcToBuffer(&buf, added);
1260 private StorageClass parseAttribute(ref AST.Expressions* udas)
1271 AST.Expression exp = parsePrimaryExp();
1275 exp = new AST.CallExp(loc, exp, parseArguments());
1279 udas = new AST.Expressions();
1289 udas = AST.UserAttributeDeclaration.concat(udas, parseArguments());
1304 private StorageClass parsePostfix(StorageClass storageClass, AST.Expressions** pudas)
1347 AST.Expressions* udas = null;
1352 *pudas = AST.UserAttributeDeclaration.concat(*pudas, udas);
1413 private AST.Expression parseConstraint()
1415 AST.Expression e = null;
1429 private AST.TemplateDeclaration parseTemplateDeclaration(bool ismixin = false)
1431 AST.TemplateDeclaration tempdecl;
1433 AST.TemplateParameters* tpl;
1434 AST.Dsymbols* decldefs;
1435 AST.Expression constraint = null;
1459 tempdecl = new AST.TemplateDeclaration(loc, id, tpl, constraint, decldefs, ismixin);
1472 private AST.TemplateParameters* parseTemplateParameterList(int flag = 0)
1474 auto tpl = new AST.TemplateParameters();
1488 AST.TemplateParameter tp;
1491 AST.Type tp_spectype = null;
1492 AST.Type tp_valtype = null;
1493 AST.Type tp_defaulttype = null;
1494 AST.Expression tp_specvalue = null;
1495 AST.Expression tp_defaultvalue = null;
1506 AST.Type spectype = null;
1539 tp = new AST.TemplateAliasParameter(loc, tp_ident, spectype, spec, def);
1562 tp = new AST.TemplateTypeParameter(loc, tp_ident, tp_spectype, tp_defaulttype);
1571 tp = new AST.TemplateTupleParameter(loc, tp_ident);
1595 tp = new AST.TemplateThisParameter(loc, tp_ident, tp_spectype, tp_defaulttype);
1617 tp = new AST.TemplateValueParameter(loc, tp_ident, tp_valtype, tp_specvalue, tp_defaultvalue);
1639 private AST.Dsymbol parseMixin()
1641 AST.TemplateMixin tm;
1643 AST.Objects* tiargs;
1650 AST.TypeQualified tqual = null;
1682 auto tempinst = new AST.TemplateInstance(loc, id, tiargs);
1684 tqual = new AST.TypeInstance(loc, tempinst);
1692 tqual = new AST.TypeIdentifier(loc, id);
1718 tm = new AST.TemplateMixin(locMixin, id, tqual, tiargs);
1733 private AST.Objects* parseTemplateArguments()
1735 AST.Objects* tiargs;
1775 private AST.Objects* parseTemplateArgumentList()
1778 auto tiargs = new AST.Objects();
1798 * RootObject representing the AST
1813 private AST.Objects* parseTemplateSingleArgument()
1816 auto tiargs = new AST.Objects();
1817 AST.Type ta;
1821 ta = new AST.TypeIdentifier(token.loc, token.ident);
1829 ta = AST.Type.tvoid;
1833 ta = AST.Type.tint8;
1837 ta = AST.Type.tuns8;
1841 ta = AST.Type.tint16;
1845 ta = AST.Type.tuns16;
1849 ta = AST.Type.tint32;
1853 ta = AST.Type.tuns32;
1857 ta = AST.Type.tint64;
1861 ta = AST.Type.tuns64;
1865 ta = AST.Type.tint128;
1869 ta = AST.Type.tuns128;
1873 ta = AST.Type.tfloat32;
1877 ta = AST.Type.tfloat64;
1881 ta = AST.Type.tfloat80;
1885 ta = AST.Type.timaginary32;
1889 ta = AST.Type.timaginary64;
1893 ta = AST.Type.timaginary80;
1897 ta = AST.Type.tcomplex32;
1901 ta = AST.Type.tcomplex64;
1905 ta = AST.Type.tcomplex80;
1909 ta = AST.Type.tbool;
1913 ta = AST.Type.tchar;
1917 ta = AST.Type.twchar;
1921 ta = AST.Type.tdchar;
1956 AST.Expression ea = parsePrimaryExp();
1971 private AST.StaticAssert parseStaticAssert()
1974 AST.Expression exp;
1975 AST.Expression msg = null;
1994 return new AST.StaticAssert(loc, exp, msg);
2001 private AST.TypeQualified parseTypeof()
2003 AST.TypeQualified t;
2011 t = new AST.TypeReturn(loc);
2015 AST.Expression exp = parseExpression(); // typeof(expression)
2016 t = new AST.TypeTypeof(loc, exp);
2026 private AST.Type parseVector()
2030 AST.Type tb = parseType();
2032 return new AST.TypeVector(tb);
2043 private ParsedLinkage!(AST) parseLinkage()
2045 ParsedLinkage!(AST) result;
2049 ParsedLinkage!(AST) returnLinkage(LINK link)
2055 ParsedLinkage!(AST) invalidLinkage()
2106 result.idents = new AST.Identifiers();
2125 result.identExps = new AST.Expressions();
2173 private AST.DebugSymbol parseDebugSpecification()
2175 AST.DebugSymbol s;
2178 s = new AST.DebugSymbol(token.loc, token.ident);
2180 s = new AST.DebugSymbol(token.loc, cast(uint)token.unsvalue);
2196 private AST.Condition parseDebugCondition()
2216 return new AST.DebugCondition(loc, mod, level, id);
2222 private AST.VersionSymbol parseVersionSpecification()
2224 AST.VersionSymbol s;
2227 s = new AST.VersionSymbol(token.loc, token.ident);
2229 s = new AST.VersionSymbol(token.loc, cast(uint)token.unsvalue);
2245 private AST.Condition parseVersionCondition()
2275 return new AST.VersionCondition(loc, mod, level, id);
2285 private AST.Condition parseStaticIfCondition()
2287 AST.Expression exp;
2288 AST.Condition condition;
2304 condition = new AST.StaticIfCondition(loc, exp);
2317 private AST.Dsymbol parseCtor(PrefixAttributes!AST* pAttrs)
2319 AST.Expressions* udas = null;
2321 StorageClass stc = getStorageClass!AST(pAttrs);
2341 auto f = new AST.PostBlitDeclaration(loc, Loc.initial, stc, Id.postblit);
2342 AST.Dsymbol s = parseContracts(f);
2345 auto a = new AST.Dsymbols();
2347 s = new AST.UserAttributeDeclaration(udas, a);
2356 AST.TemplateParameters* tpl = null;
2367 if (parameterList.varargs != VarArg.none || AST.Parameter.dim(parameterList.parameters) != 0)
2380 AST.Expression constraint = tpl ? parseConstraint() : null;
2382 AST.Type tf = new AST.TypeFunction(parameterList, null, linkage, stc); // RetrunType -> auto
2385 auto f = new AST.CtorDeclaration(loc, Loc.initial, stc, tf);
2386 AST.Dsymbol s = parseContracts(f);
2389 auto a = new AST.Dsymbols();
2391 s = new AST.UserAttributeDeclaration(udas, a);
2397 auto decldefs = new AST.Dsymbols();
2399 s = new AST.TemplateDeclaration(loc, f.ident, tpl, constraint, decldefs);
2410 private AST.Dsymbol parseDtor(PrefixAttributes!AST* pAttrs)
2412 AST.Expressions* udas = null;
2414 StorageClass stc = getStorageClass!AST(pAttrs);
2430 auto f = new AST.DtorDeclaration(loc, Loc.initial, stc, Id.dtor);
2431 AST.Dsymbol s = parseContracts(f);
2434 auto a = new AST.Dsymbols();
2436 s = new AST.UserAttributeDeclaration(udas, a);
2446 private AST.Dsymbol parseStaticCtor(PrefixAttributes!AST* pAttrs)
2450 StorageClass stc = getStorageClass!AST(pAttrs);
2465 AST.stcToBuffer(&buf, modStc);
2470 auto f = new AST.StaticCtorDeclaration(loc, Loc.initial, stc);
2471 AST.Dsymbol s = parseContracts(f);
2480 private AST.Dsymbol parseStaticDtor(PrefixAttributes!AST* pAttrs)
2482 AST.Expressions* udas = null;
2484 StorageClass stc = getStorageClass!AST(pAttrs);
2500 AST.stcToBuffer(&buf, modStc);
2505 auto f = new AST.StaticDtorDeclaration(loc, Loc.initial, stc);
2506 AST.Dsymbol s = parseContracts(f);
2509 auto a = new AST.Dsymbols();
2511 s = new AST.UserAttributeDeclaration(udas, a);
2521 private AST.Dsymbol parseSharedStaticCtor(PrefixAttributes!AST* pAttrs)
2525 StorageClass stc = getStorageClass!AST(pAttrs);
2539 AST.stcToBuffer(&buf, modStc);
2544 auto f = new AST.SharedStaticCtorDeclaration(loc, Loc.initial, stc);
2545 AST.Dsymbol s = parseContracts(f);
2554 private AST.Dsymbol parseSharedStaticDtor(PrefixAttributes!AST* pAttrs)
2556 AST.Expressions* udas = null;
2558 StorageClass stc = getStorageClass!AST(pAttrs);
2573 AST.stcToBuffer(&buf, modStc);
2578 auto f = new AST.SharedStaticDtorDeclaration(loc, Loc.initial, stc);
2579 AST.Dsymbol s = parseContracts(f);
2582 auto a = new AST.Dsymbols();
2584 s = new AST.UserAttributeDeclaration(udas, a);
2596 private AST.Dsymbol parseInvariant(PrefixAttributes!AST* pAttrs)
2599 StorageClass stc = getStorageClass!AST(pAttrs);
2607 AST.Expression e = parseAssignExp(), msg = null;
2620 e = new AST.AssertExp(loc, e, msg);
2621 auto fbody = new AST.ExpStatement(loc, e);
2622 auto f = new AST.InvariantDeclaration(loc, token.loc, stc, null, fbody);
2629 auto f = new AST.InvariantDeclaration(loc, token.loc, stc, null, fbody);
2638 private AST.Dsymbol parseUnitTest(PrefixAttributes!AST* pAttrs)
2641 StorageClass stc = getStorageClass!AST(pAttrs);
2647 AST.Statement sbody = parseStatement(ParseStatementFlags.curly, &endPtr);
2670 auto f = new AST.UnitTestDeclaration(loc, token.loc, stc, docline);
2680 private AST.Dsymbol parseNew(PrefixAttributes!AST* pAttrs)
2683 StorageClass stc = getStorageClass!AST(pAttrs);
2698 auto f = new AST.NewDeclaration(loc, stc);
2716 return new AST.NewDeclaration(loc, stc);
2723 private AST.ParameterList parseParameterList(AST.TemplateParameters** tpl)
2725 auto parameters = new AST.Parameters();
2737 AST.Type at;
2740 AST.Expression ae;
2741 AST.Expressions* udas = null;
2758 AST.stcToBuffer(&buf, varargsStc & ~VarArgsStc);
2790 AST.Expressions* exps = null;
2798 udas = AST.UserAttributeDeclaration.concat(udas, exps);
2899 at = new AST.TypeIdentifier(loc, id);
2901 *tpl = new AST.TemplateParameters();
2902 AST.TemplateParameter tp = new AST.TemplateTypeParameter(loc, id, null, null);
2927 auto param = new AST.Parameter(storageClass | STC.parameter, at, ai, ae, null);
2930 auto a = new AST.Dsymbols();
2931 auto udad = new AST.UserAttributeDeclaration(udas, a);
2936 AST.Expressions* exps = null;
2977 return AST.ParameterList(parameters, varargs, varargsStc);
2982 private AST.EnumDeclaration parseEnum()
2984 AST.EnumDeclaration e;
2986 AST.Type memtype;
3009 e = new AST.EnumDeclaration(loc, id, memtype);
3018 e.members = new AST.Dsymbols();
3031 AST.Type type = null;
3034 AST.Expressions* udas;
3036 AST.Expression deprecationMessage;
3052 AST.stcToBuffer(&buf, _stc);
3085 if (type == AST.Type.terror)
3110 if (type && type != AST.Type.terror)
3117 AST.Expression value;
3134 if (type && type != AST.Type.terror && isAnonymousEnum)
3138 AST.DeprecatedDeclaration dd;
3141 dd = new AST.DeprecatedDeclaration(deprecationMessage, null);
3145 auto em = new AST.EnumMember(loc, ident, value, type, stc, null, dd);
3150 auto s = new AST.Dsymbols();
3152 auto uad = new AST.UserAttributeDeclaration(udas, s);
3186 private AST.Dsymbol parseAggregate()
3188 AST.TemplateParameters* tpl = null;
3189 AST.Expression constraint;
3214 AST.BaseClasses* baseclasses = null;
3237 AST.Dsymbols* members = null;
3265 AST.AggregateDeclaration a;
3271 a = new AST.InterfaceDeclaration(loc, id, baseclasses);
3279 a = new AST.ClassDeclaration(loc, id, baseclasses, members, inObject);
3286 a = new AST.StructDeclaration(loc, id, inObject);
3294 return new AST.AnonDeclaration(loc, false, members);
3301 a = new AST.UnionDeclaration(loc, id);
3309 return new AST.AnonDeclaration(loc, true, members);
3320 auto decldefs = new AST.Dsymbols();
3322 auto tempdecl = new AST.TemplateDeclaration(loc, id, tpl, constraint, decldefs);
3330 private AST.BaseClasses* parseBaseClasses()
3332 auto baseclasses = new AST.BaseClasses();
3336 auto b = new AST.BaseClass(parseBasicType());
3344 AST.Dsymbols* parseImport()
3346 auto decldefs = new AST.Dsymbols();
3386 auto s = new AST.Import(loc, a, id, aliasid, isstatic);
3442 AST.Type parseType(Identifier* pident = null, AST.TemplateParameters** ptpl = null)
3496 AST.Type t;
3507 private AST.Type parseBasicType(bool dontLookDotIdents = false)
3509 AST.Type t;
3516 t = AST.Type.tvoid;
3520 t = AST.Type.tint8;
3524 t = AST.Type.tuns8;
3528 t = AST.Type.tint16;
3532 t = AST.Type.tuns16;
3536 t = AST.Type.tint32;
3540 t = AST.Type.tuns32;
3544 t = AST.Type.tint64;
3554 t = AST.Type.tfloat80;
3560 t = AST.Type.tuns64;
3564 t = AST.Type.tint128;
3568 t = AST.Type.tuns128;
3572 t = AST.Type.tfloat32;
3576 t = AST.Type.tfloat64;
3580 t = AST.Type.tfloat80;
3584 t = AST.Type.timaginary32;
3588 t = AST.Type.timaginary64;
3592 t = AST.Type.timaginary80;
3596 t = AST.Type.tcomplex32;
3600 t = AST.Type.tcomplex64;
3604 t = AST.Type.tcomplex80;
3608 t = AST.Type.tbool;
3612 t = AST.Type.tchar;
3616 t = AST.Type.twchar;
3620 t = AST.Type.tdchar;
3635 auto tempinst = new AST.TemplateInstance(loc, id, parseTemplateArguments());
3636 t = parseBasicTypeStartingAt(new AST.TypeInstance(loc, tempinst), dontLookDotIdents);
3640 t = parseBasicTypeStartingAt(new AST.TypeIdentifier(loc, id), dontLookDotIdents);
3651 t = new AST.TypeMixin(loc, exps);
3656 t = parseBasicTypeStartingAt(new AST.TypeIdentifier(token.loc, Id.empty), dontLookDotIdents);
3669 if (AST.TraitsExp te = cast(AST.TraitsExp) parsePrimaryExp())
3672 t = new AST.TypeTraits(token.loc, te);
3675 t = new AST.TypeError;
3714 t = AST.Type.terror;
3720 private AST.Type parseBasicTypeStartingAt(AST.TypeQualified tid, bool dontLookDotIdents)
3722 AST.Type maybeArray = null;
3747 AST.Objects dimStack;
3748 AST.Type t = maybeArray;
3754 AST.TypeSArray a = cast(AST.TypeSArray)t;
3761 AST.TypeAArray a = cast(AST.TypeAArray)t;
3772 tid = cast(AST.TypeQualified)t;
3784 auto tempinst = new AST.TemplateInstance(loc, id, parseTemplateArguments());
3797 AST.Type t = maybeArray ? maybeArray : cast(AST.Type)tid;
3802 t = new AST.TypeDArray(t);
3812 AST.Type index = parseType(); // [ type ]
3813 maybeArray = new AST.TypeAArray(t, index);
3825 AST.Expression e = parseAssignExp(); // [ expression ]
3830 AST.Expression e2 = parseAssignExp(); // [ exp .. exp ]
3831 t = new AST.TypeSlice(t, e, e2);
3838 maybeArray = new AST.TypeSArray(t, e);
3851 return maybeArray ? maybeArray : cast(AST.Type)tid;
3870 private AST.Type parseTypeSuffixes(AST.Type t)
3878 t = new AST.TypePointer(t);
3889 t = new AST.TypeDArray(t); // []
3896 AST.Type index = parseType(); // [ type ]
3897 t = new AST.TypeAArray(t, index);
3904 AST.Expression e = parseAssignExp(); // [ expression ]
3914 AST.Expression e2 = parseAssignExp(); // [ exp .. exp ]
3915 t = new AST.TypeSlice(t, e, e2);
3919 t = new AST.TypeSArray(t, e);
3938 auto tf = new AST.TypeFunction(parameterList, t, linkage, stc);
3944 tf = cast(AST.TypeFunction)tf.addSTC(stc);
3946 t = save == TOK.delegate_ ? new AST.TypeDelegate(tf) : new AST.TypePointer(tf); // pointer to function
3972 private AST.Type parseDeclarator(AST.Type t, ref int palt, Identifier* pident,
3973 AST.TemplateParameters** tpl = null, StorageClass storageClass = 0,
3974 bool* pdisable = null, AST.Expressions** pudas = null)
3978 AST.Type ts;
4043 AST.TypeNext ta;
4048 ta = new AST.TypeDArray(t); // []
4056 AST.Type index = parseType(); // [ type ]
4058 ta = new AST.TypeAArray(t, index);
4064 AST.Expression e = parseAssignExp(); // [ expression ]
4065 ta = new AST.TypeSArray(t, e);
4075 AST.Type* pt;
4076 for (pt = &ts; *pt != t; pt = &(cast(AST.TypeNext)*pt).next)
4116 AST.Type tf = new AST.TypeFunction(parameterList, t, linkage, stc);
4126 AST.Type* pt;
4127 for (pt = &ts; *pt != t; pt = &(cast(AST.TypeNext)*pt).next)
4142 ref bool setAlignment, ref AST.Expression ealign, ref AST.Expressions* udas,
4303 private AST.Dsymbols* parseDeclarations(bool autodecl, PrefixAttributes!AST* pAttrs, const(char)* comment)
4309 AST.Expression ealign;
4310 AST.Expressions* udas = null;
4334 AST.Type ts;
4342 AST.Dsymbol d = parseEnum();
4343 auto a = new AST.Dsymbols();
4348 d = new AST.UserAttributeDeclaration(udas, a);
4349 a = new AST.Dsymbols();
4361 AST.Dsymbol s = parseAggregate();
4362 auto a = new AST.Dsymbols();
4367 s = new AST.StorageClassDeclaration(storage_class, a);
4368 a = new AST.Dsymbols();
4373 s = new AST.AlignDeclaration(s.loc, ealign, a);
4374 a = new AST.Dsymbols();
4379 s = new AST.LinkDeclaration(linkloc, link, a);
4380 a = new AST.Dsymbols();
4385 s = new AST.UserAttributeDeclaration(udas, a);
4386 a = new AST.Dsymbols();
4400 AST.Dsymbols* a = parseAutoDeclarations(storage_class, comment);
4403 AST.Dsymbol s = new AST.UserAttributeDeclaration(udas, a);
4404 a = new AST.Dsymbols();
4443 AST.Type tfirst = null;
4444 auto a = new AST.Dsymbols();
4448 AST.TemplateParameters* tpl = null;
4462 bool isThis = (t.ty == Tident && (cast(AST.TypeIdentifier)t).ident == Id.This && token.value == TOK.assign);
4465 else if (!isThis && (t != AST.Type.terror))
4470 AST.Declaration v;
4471 AST.Initializer _init = null;
4495 v = new AST.AliasDeclaration(loc, ident, t);
4508 AST.Dsymbol s = v;
4512 auto ax = new AST.Dsymbols();
4514 s = new AST.LinkDeclaration(linkloc, link, ax);
4536 AST.Expression constraint = null;
4538 auto f = new AST.FuncDeclaration(loc, Loc.initial, ident, storage_class | (disable ? STC.disable : 0), t);
4543 AST.Dsymbol s = parseContracts(f);
4548 auto ax = new AST.Dsymbols();
4550 s = new AST.LinkDeclaration(linkloc, link, ax);
4554 auto ax = new AST.Dsymbols();
4556 s = new AST.UserAttributeDeclaration(udas, ax);
4564 auto decldefs = new AST.Dsymbols();
4566 auto tempdecl = new AST.TemplateDeclaration(loc, tplIdent, tpl, constraint, decldefs);
4584 auto ax = new AST.Dsymbols();
4586 s = new AST.StorageClassDeclaration(stc2, ax);
4594 AST.Initializer _init = null;
4601 auto v = new AST.VarDeclaration(loc, t, ident, _init);
4606 AST.Dsymbol s = v;
4610 auto a2 = new AST.Dsymbols();
4612 auto tempdecl = new AST.TemplateDeclaration(loc, ident, tpl, null, a2, 0);
4617 auto ax = new AST.Dsymbols();
4619 s = new AST.AlignDeclaration(v.loc, ealign, ax);
4623 auto ax = new AST.Dsymbols();
4625 s = new AST.LinkDeclaration(linkloc, link, ax);
4629 auto ax = new AST.Dsymbols();
4631 s = new AST.UserAttributeDeclaration(udas, ax);
4674 private AST.Dsymbols* parseAliasReassignment(const(char)* comment)
4681 AST.Dsymbol s = new AST.AliasAssign(loc, ident, t, null);
4684 auto a = new AST.Dsymbols();
4698 private AST.Dsymbols* parseAliasDeclarations(const(char)* comment)
4703 AST.Expressions* udas;
4706 AST.Expression ealign;
4715 auto s = new AST.AliasThis(loc, token.ident);
4719 auto a = new AST.Dsymbols();
4749 auto a = new AST.Dsymbols();
4754 AST.TemplateParameters* tpl = null;
4777 AST
4778 AST.Dsymbol s;
4791 AST.Type tret = parseBasicType();
4800 AST.Type tf = new AST.TypeFunction(parameterList, tret, link, storage_class);
4801 v = new AST.AliasDeclaration(loc, ident, tf);
4832 auto tpl_ = cast(AST.TemplateDeclaration) s;
4839 auto fd = cast(AST.FuncLiteralDeclaration) (*tpl_.members)[0];
4840 auto tf = cast(AST.TypeFunction) fd.type;
4842 auto as = new AST.Dsymbols();
4843 (*tf.parameterList.parameters)[0].userAttribDecl = new AST.UserAttributeDeclaration(udas, as);
4847 v = new AST.AliasDeclaration(loc, ident, s);
4870 AST.stcToBuffer(&buf, remStc);
4877 v = new AST.AliasDeclaration(loc, ident, t);
4886 auto a2 = new AST.Dsymbols();
4888 auto tempdecl = new AST.TemplateDeclaration(loc, ident, tpl, null, a2);
4893 auto a2 = new AST.Dsymbols();
4895 s = new AST.LinkDeclaration(linkloc, link, a2);
4935 private AST.Dsymbol parseFunctionLiteral()
4938 AST.TemplateParameters* tpl = null;
4939 AST.ParameterList parameterList;
4940 AST.Type tret = null;
4997 AST.stcToBuffer(&buf, modStc);
5012 parameterList.parameters = new AST.Parameters();
5014 AST.Type t = new AST.TypeIdentifier(loc, id);
5015 parameterList.parameters.push(new AST.Parameter(STC.parameter, t, token.ident, null, null));
5017 tpl = new AST.TemplateParameters();
5018 AST.TemplateParameter tp = new AST.TemplateTypeParameter(loc, id, null, null);
5028 auto tf = new AST.TypeFunction(parameterList, tret, linkage, stc);
5029 tf = cast(AST.TypeFunction)tf.addSTC(stc);
5030 auto fd = new AST.FuncLiteralDeclaration(loc, Loc.initial, tf, save, null);
5041 AST.Expression ae = parseAssignExp();
5042 fd.fbody = new AST.ReturnStatement(returnloc, ae);
5053 auto decldefs = new AST.Dsymbols();
5055 return new AST.TemplateDeclaration(fd.loc, fd.ident, tpl, null, decldefs, false, true);
5063 private AST.FuncDeclaration parseContracts(AST.FuncDeclaration f)
5083 f.fbody = new AST.ReturnStatement(returnloc, parseExpression());
5130 f.frequires = new AST.Statements;
5135 AST.Expression e = parseAssignExp(), msg = null;
5147 e = new AST.AssertExp(loc, e, msg);
5148 f.frequires.push(new AST.ExpStatement(loc, e));
5167 f.fensures = new AST.Ensures;
5183 AST.Expression e = parseAssignExp(), msg = null;
5195 e = new AST.AssertExp(loc, e, msg);
5196 f.fensures.push(AST.Ensure(id, new AST.ExpStatement(loc, e)));
5202 f.fensures.push(AST.Ensure(id, parseStatement(ParseStatementFlags.curly | ParseStatementFlags.scope_)));
5242 f.fbody = new AST.CompoundStatement(Loc.initial, cast(AST.Statement)null);
5265 private void checkCstyleTypeSyntax(Loc loc, AST.Type t, int alt, Identifier ident)
5285 private Foreach parseForeach(alias Foreach)(Loc loc, AST.Dsymbol* pLastDecl)
5287 static if (is(Foreach == AST.StaticForeachStatement) || is(Foreach == AST.StaticForeachDeclaration))
5297 auto parameters = new AST.Parameters();
5302 AST.Type at;
5387 auto p = new AST.Parameter(storageClass, at, ai, null, null);
5408 AST.Expression aggr = parseExpression();
5411 AST.Parameter p = (*parameters)[0];
5413 AST.Expression upr = parseExpression();
5416 static if (is(Foreach == AST.Statement) || is(Foreach == AST.StaticForeachStatement))
5418 AST.Statement _body = parseStatement(0, null, &endloc);
5422 AST.Statement _body = null;
5424 auto rangefe = new AST.ForeachRangeStatement(loc, op, p, aggr, upr, _body, endloc);
5425 static if (is(Foreach == AST.Statement))
5429 else static if(is(Foreach == AST.StaticForeachDeclaration))
5431 return new AST.StaticForeachDeclaration(new AST.StaticForeach(loc, null, rangefe), parseBlock(pLastDecl));
5433 else static if (is(Foreach == AST.StaticForeachStatement))
5435 return new AST.StaticForeachStatement(loc, new AST.StaticForeach(loc, null, rangefe));
5442 static if (is(Foreach == AST.Statement) || is(Foreach == AST.StaticForeachStatement))
5444 AST.Statement _body = parseStatement(0, null, &endloc);
5448 AST.Statement _body = null;
5450 auto aggrfe = new AST.ForeachStatement(loc, op, parameters, aggr, _body, endloc);
5451 static if (is(Foreach == AST.Statement))
5455 else static if(is(Foreach == AST.StaticForeachDeclaration))
5457 return new AST.StaticForeachDeclaration(new AST.StaticForeach(loc, aggrfe, null), parseBlock(pLastDecl));
5459 else static if (is(Foreach == AST.StaticForeachStatement))
5461 return new AST.StaticForeachStatement(loc, new AST.StaticForeach(loc, aggrfe, null));
5473 AST.Parameter parseAssignCondition()
5475 AST.Parameter param = null;
5537 AST.Type at = null; // infer parameter type
5540 param = new AST.Parameter(storageClass, at, ai, null, null);
5545 AST.Type at = parseType(&ai);
5547 param = new AST.Parameter(storageClass, at, ai, null, null);
5561 AST.Statement parseStatement(int flags, const(char)** endPtr = null, Loc* pEndloc = null)
5563 AST.Statement s;
5564 AST.Condition cond;
5565 AST.Statement ifbody;
5566 AST.Statement elsebody;
5602 s = new AST.LabelStatement(loc, ident, s);
5665 AST.Expression exp = parseExpression();
5697 s = new AST.ExpStatement(loc, exp);
5706 s = new AST.StaticAssertStatement(parseStaticAssert());
5716 s = parseForeach!(AST.StaticForeachStatement)(loc, null);
5718 s = new AST.ScopeStatement(loc, s, token.loc);
5723 AST.Dsymbols* imports = parseImport();
5724 s = new AST.ImportStatement(loc, imports);
5726 s = new AST.ScopeStatement(loc, s, token.loc);
5792 AST.Dsymbols* a = parseDeclarations(false, null, null);
5795 auto as = new AST.Statements();
5799 AST.Dsymbol d = (*a)[i];
5800 s = new AST.ExpStatement(loc, d);
5803 s = new AST.CompoundDeclarationStatement(loc, as);
5807 AST.Dsymbol d = (*a)[0];
5808 s = new AST.ExpStatement(loc, d);
5811 s = new AST.ExpStatement(loc, cast(AST.Expression)null);
5813 s = new AST.ScopeStatement(loc, s, token.loc);
5821 AST.Dsymbol d;
5835 s = new AST.ExpStatement(loc, d);
5837 s = new AST.ScopeStatement(loc, s, token.loc);
5847 AST.Expression e = parseAssignExp();
5851 AST.MixinExp cpe = cast(AST.MixinExp)e;
5852 s = new AST.CompileStatement(loc, cpe.exps);
5856 s = new AST.ExpStatement(loc, e);
5860 AST.Dsymbol d = parseMixin();
5861 s = new AST.ExpStatement(loc, d);
5863 s = new AST.ScopeStatement(loc, s, token.loc);
5874 auto statements = new AST.Statements();
5887 s = new AST.CompoundStatement(loc, statements);
5889 s = new AST.ScopeStatement(loc, s, token.loc);
5896 AST.Parameter param = null;
5900 AST.Expression condition = parseExpression();
5903 AST.Statement _body = parseStatement(ParseStatementFlags.scope_, null, &endloc);
5904 s = new AST.WhileStatement(loc, condition, _body, endloc, param);
5916 s = new AST.ExpStatement(loc, cast(AST.Expression)null);
5921 AST.Statement _body;
5922 AST.Expression condition;
5937 s = new AST.DoStatement(loc, _body, condition, token.loc);
5942 AST.Statement _init;
5943 AST.Expression condition;
5944 AST.Expression increment;
5981 AST.Statement _body = parseStatement(ParseStatementFlags.scope_, null, &endloc);
5982 s = new AST.ForStatement(loc, _init, condition, increment, _body, endloc);
5988 s = parseForeach!(AST.Statement)(loc, null);
5993 AST.Parameter param = null;
5994 AST.Expression condition;
6029 s = new AST.IfStatement(loc, param, condition, ifbody, elsebody, token.loc);
6063 AST.Statement st = parseStatement(ParseStatementFlags.scope_);
6064 s = new AST.ScopeGuardStatement(loc, t, st);
6115 s = new AST.ConditionalStatement(loc, cond, ifbody, elsebody);
6117 s = new AST.ScopeStatement(loc, s, token.loc);
6123 AST.Expressions* args = null;
6124 AST.Statement _body;
6146 s = new AST.PragmaStatement(loc, ident, args, _body);
6157 AST.Expression condition = parseExpression();
6159 AST.Statement _body = parseStatement(ParseStatementFlags.scope_);
6160 s = new AST.SwitchStatement(loc, condition, _body, isfinal);
6165 AST.Expression exp;
6166 AST.Expressions cases; // array of Expression's
6167 AST.Expression last = null;
6195 auto statements = new AST.Statements();
6209 s = new AST.CompoundStatement(loc, statements);
6215 s = new AST.ScopeStatement(loc, s, token.loc);
6219 s = new AST.CaseRangeStatement(loc, exp, last, s);
6227 s = new AST.CaseStatement(loc, exp, s);
6239 auto statements = new AST.Statements();
6244 s = new AST.CompoundStatement(loc, statements);
6248 s = new AST.ScopeStatement(loc, s, token.loc);
6249 s = new AST.DefaultStatement(loc, s);
6254 AST.Expression exp;
6258 s = new AST.ReturnStatement(loc, exp);
6272 s = new AST.BreakStatement(loc, ident);
6286 s = new AST.ContinueStatement(loc, ident);
6296 s = new AST.GotoDefaultStatement(loc);
6300 AST.Expression exp = null;
6304 s = new AST.GotoCaseStatement(loc, exp);
6318 s = new AST.GotoStatement(loc, ident);
6325 AST.Expression exp;
6326 AST.Statement _body;
6342 s = new AST.SynchronizedStatement(loc, exp, _body);
6347 AST.Expression exp;
6348 AST.Statement _body;
6356 s = new AST.WithStatement(loc, exp, _body, endloc);
6361 AST.Statement _body;
6362 AST.Catches* catches = null;
6363 AST.Statement finalbody = null;
6372 AST.Statement handler;
6373 AST.Catch c;
6374 AST.Type t;
6394 c = new AST.Catch(catchloc, t, id, handler);
6396 catches = new AST.Catches();
6412 s = new AST.TryCatchStatement(loc, _body, catches);
6414 s = new AST.TryFinallyStatement(loc, s, finalbody);
6420 AST.Expression exp;
6424 s = new AST.ThrowStatement(loc, exp);
6445 AST.Expression e = parseExpression();
6447 s = new AST.ExpStatement(loc, e);
6451 AST.Dsymbols* imports = parseImport();
6452 s = new AST.ImportStatement(loc, imports);
6454 s = new AST.ScopeStatement(loc, s, token.loc);
6460 AST.Dsymbol d = parseTemplateDeclaration();
6461 s = new AST.ExpStatement(loc, d);
6482 private AST.ExpInitializer parseExpInitializer(Loc loc)
6485 return new AST.ExpInitializer(loc, ae);
6488 private AST.Initializer parseStructInitializer(Loc loc)
6574 auto _is = new AST.StructInitializer(loc);
6631 private AST.Initializer parseInitializer()
6673 auto ia = new AST.ArrayInitializer(loc);
6692 AST.Initializer value;
6700 value = new AST.ExpInitializer(e.loc, e);
6712 AST.Expression e;
6753 return new AST.VoidInitializer(loc);
6766 private AST.Expression parseDefaultInitExp()
6768 AST.Expression e = null;
6774 case TOK.file: e = new AST.FileInitExp(token.loc, EXP.file); break;
6775 case TOK.fileFullPath: e = new AST.FileInitExp(token.loc, EXP.fileFullPath); break;
6776 case TOK.line: e = new AST.LineInitExp(token.loc); break;
6777 case TOK.moduleString: e = new AST.ModuleInitExp(token.loc); break;
6778 case TOK.functionString: e = new AST.FuncInitExp(token.loc); break;
6779 case TOK.prettyFunction: e = new AST.PrettyFuncInitExp(token.loc); break;
6794 AST.Statement parseAsm()
6813 auto statements = new AST.Statements();
6858 AST.Statement s = new AST.AsmStatement(token.loc, toklist);
6863 s = new AST.LabelStatement(labelloc, label, s);
6902 auto s = new AST.CompoundAsmStatement(loc, statements, stc);
6945 private void checkParens(TOK value, AST.Expression e)
7815 AST.Expression parseExpression()
7825 e = new AST.CommaExp(loc, e, e2, false);
7833 AST.Expression parsePrimaryExp()
7835 AST.Expression e;
7836 AST.Type t;
7863 auto tempinst = new AST.TemplateInstance(loc, id, parseTemplateArguments());
7864 e = new AST.ScopeExp(loc, tempinst);
7867 e = new AST.IdentifierExp(loc, id);
7873 e = new AST.DollarExp(loc);
7879 e = new AST.IdentifierExp(loc, Id.empty);
7883 e = new AST.ThisExp(loc);
7888 e = new AST.SuperExp(loc);
7893 e = new AST.IntegerExp(loc, token.intvalue, AST.Type.tint32);
7898 e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.tuns32);
7903 e = new AST.IntegerExp(loc, token.intvalue, AST.Type.tint64);
7908 e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.tuns64);
7913 e = new AST.RealExp(loc, token.floatvalue, AST.Type.tfloat32);
7918 e = new AST.RealExp(loc, token.floatvalue, AST.Type.tfloat64);
7923 e = new AST.RealExp(loc, token.floatvalue, AST.Type.tfloat80);
7928 e = new AST.RealExp(loc, token.floatvalue, AST.Type.timaginary32);
7933 e = new AST.RealExp(loc, token.floatvalue, AST.Type.timaginary64);
7938 e = new AST.RealExp(loc, token.floatvalue, AST.Type.timaginary80);
7943 e = new AST.NullExp(loc);
7950 e = new AST.StringExp(loc, s.toDString());
7958 e = new AST.StringExp(loc, s.toDString());
7964 e = new AST.IntegerExp(loc, loc.linnum, AST.Type.tint32);
7971 e = new AST.StringExp(loc, s.toDString());
7976 e = new AST.FuncInitExp(loc);
7981 e = new AST.PrettyFuncInitExp(loc);
7986 e = new AST.IntegerExp(loc, 1, AST.Type.tbool);
7991 e = new AST.IntegerExp(loc, 0, AST.Type.tbool);
7996 e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.tchar);
8001 e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.twchar);
8006 e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.tdchar);
8045 e = new AST.StringExp(loc, s[0 .. len], len, 1, postfix);
8049 t = AST.Type.tvoid;
8053 t = AST.Type.tint8;
8057 t = AST.Type.tuns8;
8061 t = AST.Type.tint16;
8065 t = AST.Type.tuns16;
8069 t = AST.Type.tint32;
8073 t = AST.Type.tuns32;
8077 t = AST.Type.tint64;
8081 t = AST.Type.tuns64;
8085 t = AST.Type.tint128;
8089 t = AST.Type.tuns128;
8093 t = AST.Type.tfloat32;
8097 t = AST.Type.tfloat64;
8101 t = AST.Type.tfloat80;
8105 t = AST.Type.timaginary32;
8109 t = AST.Type.timaginary64;
8113 t = AST.Type.timaginary80;
8117 t = AST.Type.tcomplex32;
8121 t = AST.Type.tcomplex64;
8125 t = AST.Type.tcomplex80;
8129 t = AST.Type.tbool;
8133 t = AST.Type.tchar;
8137 t = AST.Type.twchar;
8141 t = AST.Type.tdchar;
8147 e = new AST.TypeExp(loc, t);
8148 e = new AST.CallExp(loc, e, parseArguments());
8157 e = new AST.DotIdExp(loc, new AST.TypeExp(loc, t), token.ident);
8164 e = new AST.TypeExp(loc, t);
8170 e = new AST.TypeExp(loc, t);
8179 e = new AST.TypeidExp(loc, o);
8187 AST.Objects* args = null;
8203 e = new AST.TraitsExp(loc, ident, args);
8208 AST.Type targ;
8210 AST.Type tspec = null;
8213 AST.TemplateParameters* tpl = null;
8257 tpl = new AST.TemplateParameters();
8269 e = new AST.IsExp(loc, targ, ident, tok, tspec, tok2, tpl);
8275 AST.Expression msg = null;
8291 e = new AST.AssertExp(loc, e, msg);
8301 e = new AST.MixinExp(loc, exps);
8310 e = new AST.ImportExp(loc, e);
8356 auto values = new AST.Expressions();
8357 AST.Expressions* keys = null;
8367 keys = new AST.Expressions();
8384 e = new AST.AssocArrayLiteralExp(loc, keys, values);
8386 e = new AST.ArrayLiteralExp(loc, null, values);
8394 AST.Dsymbol s = parseFunctionLiteral();
8395 e = new AST.FuncExp(loc, s);
8403 e = new AST.IntegerExp(loc, 0, AST.Type.tint32);
8410 private AST.Expression parseUnaryExp()
8412 AST.Expression e;
8420 e = new AST.AddrExp(loc, e);
8427 e = new AST.PreExp(EXP.prePlusPlus, loc, e);
8434 e = new AST.PreExp(EXP.preMinusMinus, loc, e);
8440 e = new AST.PtrExp(loc, e);
8446 e = new AST.NegExp(loc, e);
8452 e = new AST.UAddExp(loc, e);
8458 e = new AST.NotExp(loc, e);
8464 e = new AST.ComExp(loc, e);
8473 e = new AST.DeleteExp(loc, e, false);
8525 e = new AST.CastExp(loc, e, m);
8529 AST.Type t = parseType(); // cast( type )
8533 e = new AST.CastExp(loc, e, t);
8544 AST.Type t = parseBasicType();
8555 e = new AST.DotIdExp(loc, new AST.TypeExp(loc, t), token.ident);
8561 e = new AST.TypeExp(loc, t);
8567 e = new AST.CallExp(loc, e, parseArguments());
8674 e = new AST.TypeExp(loc, t);
8681 e = new AST.CastExp(loc, e, t);
8701 AST.Expression exp = parseAssignExp();
8702 e = new AST.ThrowExp(loc, exp);
8717 AST.Expression e2 = parseUnaryExp();
8718 e = new AST.PowExp(loc, e, e2);
8724 private AST.Expression parsePostExp(AST.Expression e)
8740 AST.Objects* tiargs = parseTemplateArguments();
8741 e = new AST.DotTemplateInstanceExp(loc, e, id, tiargs);
8744 e = new AST.DotIdExp(loc, e, id);
8756 e = new AST.PostExp(EXP.plusPlus, loc, e);
8760 e = new AST.PostExp(EXP.minusMinus, loc, e);
8764 e = new AST.CallExp(loc, e, parseArguments());
8773 AST.Expression index;
8774 AST.Expression upr;
8775 auto arguments = new AST.Expressions();
8787 arguments.push(new AST.IntervalExp(loc, index, upr));
8797 e = new AST.ArrayExp(loc, e, arguments);
8807 private AST.Expression parseMulExp()
8819 e = new AST.MulExp(loc, e, e2);
8825 e = new AST.DivExp(loc, e, e2);
8831 e = new AST.ModExp(loc, e, e2);
8842 private AST.Expression parseAddExp()
8854 e = new AST.AddExp(loc, e, e2);
8860 e = new AST.MinExp(loc, e, e2);
8866 e = new AST.CatExp(loc, e, e2);
8877 private AST.Expression parseShiftExp()
8889 e = new AST.ShlExp(loc, e, e2);
8895 e = new AST.ShrExp(loc, e, e2);
8901 e = new AST.UshrExp(loc, e, e2);
8912 private AST.Expression parseCmpExp()
8926 e = new AST.EqualExp(op, loc, e, e2);
8938 e = new AST.InExp(loc, e, e2);
8939 e = new AST.NotExp(loc, e);
8952 e = new AST.IdentityExp(op, loc, e, e2);
8962 e = new AST.CmpExp(op, loc, e, e2);
8968 e = new AST.InExp(loc, e, e2);
8977 private AST.Expression parseAndExp()
8987 e = new AST.AndExp(loc, e, e2);
8993 private AST.Expression parseXorExp()
9004 e = new AST.XorExp(loc, e, e2);
9009 private AST.Expression parseOrExp()
9020 e = new AST.OrExp(loc, e, e2);
9025 private AST.Expression parseAndAndExp()
9034 e = new AST.LogicalExp(loc, EXP.andAnd, e, e2);
9039 private AST.Expression parseOrOrExp()
9048 e = new AST.LogicalExp(loc, EXP.orOr, e, e2);
9053 private AST.Expression parseCondExp()
9064 e = new AST.CondExp(loc, e, e1, e2);
9069 AST.Expression parseAssignExp()
9071 AST.Expression e;
9091 e = new AST.AssignExp(loc, e, e2);
9098 e = new AST.AddAssignExp(loc, e, e2);
9105 e = new AST.MinAssignExp(loc, e, e2);
9112 e = new AST.MulAssignExp(loc, e, e2);
9119 e = new AST.DivAssignExp(loc, e, e2);
9126 e = new AST.ModAssignExp(loc, e, e2);
9133 e = new AST.PowAssignExp(loc, e, e2);
9140 e = new AST.AndAssignExp(loc, e, e2);
9147 e = new AST.OrAssignExp(loc, e, e2);
9154 e = new AST.XorAssignExp(loc, e, e2);
9161 e = new AST.ShlAssignExp(loc, e, e2);
9168 AST.ShrAssignExp(loc, e, e2);
9175 e = new AST.UshrAssignExp(loc, e, e2);
9182 e = new AST.CatAssignExp(loc, e, e2);
9196 private AST.Expressions* parseArguments()
9199 AST.Expressions* arguments;
9201 arguments = new AST.Expressions();
9223 private AST.Expression parseNewExp(AST.Expression thisexp)
9228 AST.Expressions* arguments = null;
9237 AST.BaseClasses* baseclasses = null;
9242 AST.Dsymbols* members = null;
9257 auto cd = new AST.ClassDeclaration(loc, id, baseclasses, members, false);
9258 auto e = new AST.NewAnonClassExp(loc, thisexp, cd, arguments);
9268 AST.TypeAArray taa = cast(AST.TypeAArray)t;
9269 AST.Type index = taa.index;
9270 auto edim = AST.typeToExpression(index);
9274 return new AST.NullExp(loc);
9276 t = new AST.TypeSArray(taa.next, edim);
9283 auto e = new AST.NewExp(loc, thisexp, t, arguments);
9289 private void addComment(AST.Dsymbol s, const(char)* blockComment)
9295 private void addComment(AST.Dsymbol s, const(char)[] blockComment)
9513 struct PrefixAttributes(AST)
9516 AST.Expression depmsg;
9518 AST.Visibility visibility;
9520 AST.Expression ealign;
9521 AST.Expressions* udas;
9526 struct ParsedLinkage(AST)
9533 AST.Identifiers* idents;
9535 AST.Expressions* identExps;
9567 private StorageClass getStorageClass(AST)(PrefixAttributes!(AST)* pAttrs)