diff --git a/src/lang/cpp/AST.rsc b/src/lang/cpp/AST.rsc index db2ce5ce..260681d0 100644 --- a/src/lang/cpp/AST.rsc +++ b/src/lang/cpp/AST.rsc @@ -131,7 +131,7 @@ data Declaration(list[Attribute] attributes = [], loc src=|unknown:///|, bool is ; -data Expression(loc src = |unknown:///|, TypeSymbol typ = \unresolved(), bool isMacroExpansion = false) //no attributes +data Expression(loc src = |unknown:///|, loc decl=|not-overloaded:///|, TypeSymbol typ = \unresolved(), bool isMacroExpansion = false) //no attributes = \multiply(Expression lhs, Expression rhs) | \divide(Expression lhs, Expression rhs) | \modulo(Expression lhs, Expression rhs) diff --git a/src/lang/cpp/ASTgen.rsc b/src/lang/cpp/ASTgen.rsc index 5dbece9a..4998c2b9 100644 --- a/src/lang/cpp/ASTgen.rsc +++ b/src/lang/cpp/ASTgen.rsc @@ -154,7 +154,7 @@ str type2FactoryCall(Symbol t){ bool hasDecl("Declaration", str cname) = cname in {"enumerator", "usingDirective", "sttClass", "sttTypename", "tttParameter", "tttParameterWithDefault", "baseSpecifier", "namespaceDefinition", "namespaceDefinitionInline", "usingDeclaration", "namespaceAlias", "alias", "pointerToMember"}; bool hasDecl("Expression", str cname) - = cname in {"new", "newWithArgs", "globalNew", "globalNewWithArgs", "idExpression", "fieldReference", "fieldReferencePointerDeref", "templateId", "constructorChainInitializer", "capture", "captureByRef"}; + = cname in {"new", "newWithArgs", "globalNew", "globalNewWithArgs", "idExpression", "fieldReference", "fieldReferencePointerDeref", "templateId", "constructorChainInitializer", "capture", "captureByRef"} || hasTyp("Expression", cname); bool hasDecl("Statement", str cname) = cname in {"label", "goto"}; bool hasDecl("Name", "qualifiedName") = true; bool hasDecl("Name", "templateId") = true; diff --git a/src/lang/cpp/M3.rsc b/src/lang/cpp/M3.rsc index 9603ffa2..286b3e6c 100644 --- a/src/lang/cpp/M3.rsc +++ b/src/lang/cpp/M3.rsc @@ -78,12 +78,12 @@ M3 cppASTToM3(Declaration tu, M3 model = m3(tu.src.top)) { = { // direct function calls *{ | /functionCall(Expression functionName, _) := body, functionName.decl?}, - // calls via brackets + // calls via brackets (TODO: missing case for `operator ()` overloads) *{ | /functionCall(Expression functionName, _) := body, functionName is bracketed, functionName.expression.decl?}, - // constructor calls - *{ | /Expression e := body, e is new || e is newWithArgs || e is globalNew || e is globalNewWithArgs, e.decl?} - + // constructor calls and operator invocations + *{ | /Expression e := body, e is new || e is newWithArgs || e is globalNew || e is globalNewWithArgs || str _(_,_) := e || str _(_) := e, e.decl?} + | /functionDefinition(_, Declarator declarator, _, Statement body) := tu } ; @@ -105,7 +105,7 @@ rel[loc caller, loc callee] extractCallGraph(Declaration ast) = extractCallGraph @synopsis{extracts dependencies between every declaration and every name that is used in it, that is not-not a "call"} rel[loc caller, loc callee] extractCallGraph(set[Declaration] asts) = { | ast <- asts, /Declaration caller := ast, caller has declarator, /Expression c := caller, c has decl, - c.decl.scheme notin {"cpp+class", "cpp+enumerator", "cpp+field", "cpp+parameter", "cpp+typedef", "cpp+variable", "c+variable", "unknown", "cpp+unknown"} }; //Over-approximation + c.decl.scheme notin {"not-overloaded", "cpp+class", "cpp+enumerator", "cpp+field", "cpp+parameter", "cpp+typedef", "cpp+variable", "c+variable", "unknown", "cpp+unknown"} }; //Over-approximation private loc pretty(loc subject) = |:///| + pretty(subject.path); private str pretty(str path) = replaceAll(path, "\\", "/"); diff --git a/src/lang/cpp/internal/AST.java b/src/lang/cpp/internal/AST.java index 71d7be5b..0370c322 100644 --- a/src/lang/cpp/internal/AST.java +++ b/src/lang/cpp/internal/AST.java @@ -680,6 +680,8 @@ public AST (IValueFactory vf) { = tf.constructor(typestore,_TypeSymbol,"unspecified"); private static final Type _TypeSymbol_eUnionTemplate_2 = tf.constructor(typestore,_TypeSymbol,"eUnionTemplate",tf.sourceLocationType(),"decl",tf.listType(tf.sourceLocationType()),"templateParameters"); + private static final Type _TypeSymbol_class_1 + = tf.constructor(typestore,_TypeSymbol,"class",tf.sourceLocationType(),"decl"); private static final Type _TypeSymbol___nullType_0 = tf.constructor(typestore,_TypeSymbol,"__nullType"); private static final Type _TypeSymbol_eClassTemplate_2 @@ -748,10 +750,6 @@ public AST (IValueFactory vf) { = tf.constructor(typestore,_TypeSymbol,"cUnionTemplate",tf.sourceLocationType(),"decl",tf.listType(tf.sourceLocationType()),"templateParameters"); private static final Type _TypeSymbol_functionSetType_2 = tf.constructor(typestore,_TypeSymbol,"functionSetType",tf.sourceLocationType(),"decl",tf.listType(_TypeSymbol),"templateArguments"); - private static final Type _TypeSymbol_unaryTypeTransformation_2 - = tf.constructor(typestore,_TypeSymbol,"unaryTypeTransformation",tf.stringType(),"operator",_TypeSymbol,"operand"); - private static final Type _TypeSymbol_class_1 - = tf.constructor(typestore,_TypeSymbol,"class",tf.sourceLocationType(),"decl"); private static final Type _TypeSymbol_typeOfDependentExpression_1 = tf.constructor(typestore,_TypeSymbol,"typeOfDependentExpression",tf.stringType(),"name"); private static final Type _TypeSymbol_implicitTemplateTypeParameter_2 @@ -2699,7 +2697,7 @@ public IConstructor Expression_empty(ISourceLocation $loc, boolean $isMacroExpan return vf.constructor(_Expression_empty_0 ).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_hasTrivialDestructor(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_hasTrivialDestructor(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -2708,13 +2706,13 @@ public IConstructor Expression_hasTrivialDestructor(IConstructor $expression, IS Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_hasTrivialDestructor_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_not(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_not(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -2723,7 +2721,7 @@ public IConstructor Expression_not(IConstructor $expression, ISourceLocation $lo Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_not_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -2748,7 +2746,7 @@ public IConstructor Expression_newWithArgs(IList $arguments, IConstructor $typeI return vf.constructor(_Expression_newWithArgs_2 , $arguments, $typeId).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_shiftLeftAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_shiftLeftAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -2761,7 +2759,7 @@ public IConstructor Expression_shiftLeftAssign(IConstructor $lhs, IConstructor $ Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_shiftLeftAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); @@ -2786,7 +2784,7 @@ public IConstructor Expression_typeId(IConstructor $declSpecifier, IConstructor return vf.constructor(_Expression_typeId_2 , $declSpecifier, $abstractDeclarator).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_star(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_star(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -2795,13 +2793,13 @@ public IConstructor Expression_star(IConstructor $expression, ISourceLocation $l Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_star_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_divide(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_divide(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -2814,7 +2812,7 @@ public IConstructor Expression_divide(IConstructor $lhs, IConstructor $rhs, ISou Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_divide_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); @@ -2831,7 +2829,7 @@ public IConstructor Expression_captureThisPtr(ISourceLocation $loc, boolean $isM return vf.constructor(_Expression_captureThisPtr_0 ).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_shiftRight(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_shiftRight(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -2844,13 +2842,13 @@ public IConstructor Expression_shiftRight(IConstructor $lhs, IConstructor $rhs, Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_shiftRight_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_stringLiteral(String $value, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_stringLiteral(String $value, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!vf.string($value).getType().isSubtypeOf(tf.stringType())) { throw new IllegalArgumentException("Expected " + tf.stringType() + " but got " + vf.string($value).getType() + " for vf.string($value):" + vf.string($value)); @@ -2859,13 +2857,13 @@ public IConstructor Expression_stringLiteral(String $value, ISourceLocation $loc Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_stringLiteral_1 , vf.string($value)).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_typeof(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_typeof(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -2874,13 +2872,13 @@ public IConstructor Expression_typeof(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_typeof_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_greaterEqual(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_greaterEqual(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -2893,13 +2891,13 @@ public IConstructor Expression_greaterEqual(IConstructor $lhs, IConstructor $rhs Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_greaterEqual_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_binaryXor(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_binaryXor(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -2912,13 +2910,13 @@ public IConstructor Expression_binaryXor(IConstructor $lhs, IConstructor $rhs, I Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_binaryXor_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isStandardLayout(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isStandardLayout(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -2927,13 +2925,13 @@ public IConstructor Expression_isStandardLayout(IConstructor $expression, ISourc Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isStandardLayout_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_plus(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_plus(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -2946,13 +2944,13 @@ public IConstructor Expression_plus(IConstructor $lhs, IConstructor $rhs, ISourc Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_plus_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_amper(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_amper(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -2961,13 +2959,13 @@ public IConstructor Expression_amper(IConstructor $expression, ISourceLocation $ Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_amper_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_arraySubscriptExpression(IConstructor $array, IConstructor $argument, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_arraySubscriptExpression(IConstructor $array, IConstructor $argument, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$array.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $array.getType() + " for $array:" + $array); @@ -2980,13 +2978,13 @@ public IConstructor Expression_arraySubscriptExpression(IConstructor $array, ICo Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_arraySubscriptExpression_2 , $array, $argument).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_lessThan(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_lessThan(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -2999,13 +2997,13 @@ public IConstructor Expression_lessThan(IConstructor $lhs, IConstructor $rhs, IS Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_lessThan_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_functionCall(IConstructor $functionName, IList $arguments, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_functionCall(IConstructor $functionName, IList $arguments, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$functionName.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $functionName.getType() + " for $functionName:" + $functionName); @@ -3018,13 +3016,13 @@ public IConstructor Expression_functionCall(IConstructor $functionName, IList $a Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_functionCall_2 , $functionName, $arguments).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_globalVectoredDelete(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_globalVectoredDelete(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3033,13 +3031,13 @@ public IConstructor Expression_globalVectoredDelete(IConstructor $expression, IS Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_globalVectoredDelete_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_minus(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_minus(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3048,7 +3046,7 @@ public IConstructor Expression_minus(IConstructor $expression, ISourceLocation $ Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_minus_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -3073,7 +3071,7 @@ public IConstructor Expression_constructorChainInitializer(IConstructor $name, I return vf.constructor(_Expression_constructorChainInitializer_2 , $name, $initializer).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_lessEqual(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_lessEqual(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3086,13 +3084,13 @@ public IConstructor Expression_lessEqual(IConstructor $lhs, IConstructor $rhs, I Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_lessEqual_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_greaterThan(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_greaterThan(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3105,7 +3103,7 @@ public IConstructor Expression_greaterThan(IConstructor $lhs, IConstructor $rhs, Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_greaterThan_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); @@ -3130,7 +3128,7 @@ public IConstructor Expression_globalNewWithArgs(IList $arguments, IConstructor return vf.constructor(_Expression_globalNewWithArgs_2 , $arguments, $typeId).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_labelReference(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_labelReference(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3139,7 +3137,7 @@ public IConstructor Expression_labelReference(IConstructor $expression, ISourceL Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_labelReference_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -3183,18 +3181,18 @@ public IConstructor Expression_newWithArgs(IList $arguments, IConstructor $typeI return vf.constructor(_Expression_newWithArgs_3 , $arguments, $typeId, $initializer).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_true(ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_true(ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_true_0 ).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_charConstant(String $value, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_charConstant(String $value, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!vf.string($value).getType().isSubtypeOf(tf.stringType())) { throw new IllegalArgumentException("Expected " + tf.stringType() + " but got " + vf.string($value).getType() + " for vf.string($value):" + vf.string($value)); @@ -3203,13 +3201,13 @@ public IConstructor Expression_charConstant(String $value, ISourceLocation $loc, Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_charConstant_1 , vf.string($value)).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_typeid(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_typeid(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3218,7 +3216,7 @@ public IConstructor Expression_typeid(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_typeid_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -3247,7 +3245,7 @@ public IConstructor Expression_globalNewWithArgs(IList $arguments, IConstructor return vf.constructor(_Expression_globalNewWithArgs_3 , $arguments, $typeId, $initializer).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_equals(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_equals(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3260,13 +3258,13 @@ public IConstructor Expression_equals(IConstructor $lhs, IConstructor $rhs, ISou Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_equals_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_minusAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_minusAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3279,7 +3277,7 @@ public IConstructor Expression_minusAssign(IConstructor $lhs, IConstructor $rhs, Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_minusAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); @@ -3319,7 +3317,7 @@ public IConstructor Expression_nyi(String $raw, ISourceLocation $loc, boolean $i return vf.constructor(_Expression_nyi_1 , vf.string($raw)).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isPod(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isPod(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3328,13 +3326,13 @@ public IConstructor Expression_isPod(IConstructor $expression, ISourceLocation $ Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isPod_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_minus(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_minus(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3347,7 +3345,7 @@ public IConstructor Expression_minus(IConstructor $lhs, IConstructor $rhs, ISour Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_minus_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); @@ -3374,7 +3372,7 @@ public IConstructor Expression_arrayModifier(IList $modifiers, IConstructor $con return vf.constructor(_Expression_arrayModifier_2 , $modifiers, $constExpression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isTriviallyCopyable(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isTriviallyCopyable(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3383,13 +3381,13 @@ public IConstructor Expression_isTriviallyCopyable(IConstructor $expression, ISo Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isTriviallyCopyable_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_noexcept(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_noexcept(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3398,13 +3396,13 @@ public IConstructor Expression_noexcept(IConstructor $expression, ISourceLocatio Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_noexcept_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_hasNothrowAssign(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_hasNothrowAssign(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3413,13 +3411,13 @@ public IConstructor Expression_hasNothrowAssign(IConstructor $expression, ISourc Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_hasNothrowAssign_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isConstructable(IList $args, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isConstructable(IList $args, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$args.getType().isSubtypeOf(tf.listType(_Expression))) { throw new IllegalArgumentException("Expected " + tf.listType(_Expression) + " but got " + $args.getType() + " for $args:" + $args); @@ -3428,13 +3426,13 @@ public IConstructor Expression_isConstructable(IList $args, ISourceLocation $loc Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isConstructable_1 , $args).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_plus(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_plus(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3443,7 +3441,7 @@ public IConstructor Expression_plus(IConstructor $expression, ISourceLocation $l Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_plus_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -3498,7 +3496,7 @@ public IConstructor Expression_arrayRangeDesignator(IConstructor $rangeFloor, IC return vf.constructor(_Expression_arrayRangeDesignator_2 , $rangeFloor, $rangeCeiling).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_notEquals(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_notEquals(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3511,13 +3509,13 @@ public IConstructor Expression_notEquals(IConstructor $lhs, IConstructor $rhs, I Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_notEquals_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_reinterpretCast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_reinterpretCast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$typeId.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $typeId.getType() + " for $typeId:" + $typeId); @@ -3530,7 +3528,7 @@ public IConstructor Expression_reinterpretCast(IConstructor $typeId, IConstructo Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_reinterpretCast_2 , $typeId, $expression).asWithKeywordParameters().setParameters(kwParams); @@ -3551,7 +3549,7 @@ public IConstructor Expression_capture(IConstructor $name, ISourceLocation $loc, return vf.constructor(_Expression_capture_1 , $name).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isBaseOf(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isBaseOf(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3564,13 +3562,13 @@ public IConstructor Expression_isBaseOf(IConstructor $lhs, IConstructor $rhs, IS Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isBaseOf_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_min(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_min(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3583,24 +3581,24 @@ public IConstructor Expression_min(IConstructor $lhs, IConstructor $rhs, ISource Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_min_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_false(ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_false(ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_false_0 ).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_binaryOrAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_binaryOrAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3613,13 +3611,13 @@ public IConstructor Expression_binaryOrAssign(IConstructor $lhs, IConstructor $r Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_binaryOrAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_tilde(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_tilde(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3628,13 +3626,13 @@ public IConstructor Expression_tilde(IConstructor $expression, ISourceLocation $ Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_tilde_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_multiplyAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_multiplyAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3647,13 +3645,13 @@ public IConstructor Expression_multiplyAssign(IConstructor $lhs, IConstructor $r Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_multiplyAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isTriviallyConstructable(IList $args, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isTriviallyConstructable(IList $args, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$args.getType().isSubtypeOf(tf.listType(_Expression))) { throw new IllegalArgumentException("Expected " + tf.listType(_Expression) + " but got " + $args.getType() + " for $args:" + $args); @@ -3662,13 +3660,13 @@ public IConstructor Expression_isTriviallyConstructable(IList $args, ISourceLoca Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isTriviallyConstructable_1 , $args).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_sizeof(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_sizeof(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3677,13 +3675,13 @@ public IConstructor Expression_sizeof(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_sizeof_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_cast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_cast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$typeId.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $typeId.getType() + " for $typeId:" + $typeId); @@ -3696,13 +3694,13 @@ public IConstructor Expression_cast(IConstructor $typeId, IConstructor $expressi Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_cast_2 , $typeId, $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isLiteralType(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isLiteralType(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3711,13 +3709,13 @@ public IConstructor Expression_isLiteralType(IConstructor $expression, ISourceLo Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isLiteralType_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isTrivial(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isTrivial(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3726,13 +3724,13 @@ public IConstructor Expression_isTrivial(IConstructor $expression, ISourceLocati Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isTrivial_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isTriviallyAssignable(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isTriviallyAssignable(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3745,13 +3743,13 @@ public IConstructor Expression_isTriviallyAssignable(IConstructor $lhs, IConstru Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isTriviallyAssignable_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_ellipses(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_ellipses(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3764,13 +3762,13 @@ public IConstructor Expression_ellipses(IConstructor $lhs, IConstructor $rhs, IS Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_ellipses_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_dynamicCast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_dynamicCast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$typeId.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $typeId.getType() + " for $typeId:" + $typeId); @@ -3783,13 +3781,13 @@ public IConstructor Expression_dynamicCast(IConstructor $typeId, IConstructor $e Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_dynamicCast_2 , $typeId, $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_hasTrivialAssign(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_hasTrivialAssign(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3798,13 +3796,13 @@ public IConstructor Expression_hasTrivialAssign(IConstructor $expression, ISourc Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_hasTrivialAssign_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_simpleTypeConstructor(IConstructor $declSpecifier, IConstructor $initializer, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_simpleTypeConstructor(IConstructor $declSpecifier, IConstructor $initializer, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$declSpecifier.getType().isSubtypeOf(_DeclSpecifier)) { throw new IllegalArgumentException("Expected " + _DeclSpecifier + " but got " + $declSpecifier.getType() + " for $declSpecifier:" + $declSpecifier); @@ -3817,13 +3815,13 @@ public IConstructor Expression_simpleTypeConstructor(IConstructor $declSpecifier Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_simpleTypeConstructor_2 , $declSpecifier, $initializer).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_binaryAnd(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_binaryAnd(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3836,13 +3834,13 @@ public IConstructor Expression_binaryAnd(IConstructor $lhs, IConstructor $rhs, I Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_binaryAnd_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_modulo(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_modulo(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3855,13 +3853,13 @@ public IConstructor Expression_modulo(IConstructor $lhs, IConstructor $rhs, ISou Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_modulo_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_conditional(IConstructor $condition, IConstructor $negative, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_conditional(IConstructor $condition, IConstructor $negative, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$condition.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $condition.getType() + " for $condition:" + $condition); @@ -3874,35 +3872,35 @@ public IConstructor Expression_conditional(IConstructor $condition, IConstructor Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_conditional_2 , $condition, $negative).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_throw(ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_throw(ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_throw_0 ).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_nullptr(ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_nullptr(ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_nullptr_0 ).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_alignOf(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_alignOf(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3911,7 +3909,7 @@ public IConstructor Expression_alignOf(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_alignOf_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -3951,7 +3949,7 @@ public IConstructor Expression_initializerList(IList $clauses, ISourceLocation $ return vf.constructor(_Expression_initializerList_1 , $clauses).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_divideAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_divideAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -3964,13 +3962,13 @@ public IConstructor Expression_divideAssign(IConstructor $lhs, IConstructor $rhs Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_divideAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isEmpty(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isEmpty(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3979,13 +3977,13 @@ public IConstructor Expression_isEmpty(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isEmpty_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_prefixDecr(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_prefixDecr(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -3994,13 +3992,13 @@ public IConstructor Expression_prefixDecr(IConstructor $expression, ISourceLocat Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_prefixDecr_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_binaryXorAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_binaryXorAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4013,13 +4011,13 @@ public IConstructor Expression_binaryXorAssign(IConstructor $lhs, IConstructor $ Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_binaryXorAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_shiftLeft(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_shiftLeft(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4032,13 +4030,13 @@ public IConstructor Expression_shiftLeft(IConstructor $lhs, IConstructor $rhs, I Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_shiftLeft_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_lambda(IConstructor $captureDefault, IList $captures, IConstructor $declarator, IConstructor $body, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_lambda(IConstructor $captureDefault, IList $captures, IConstructor $declarator, IConstructor $body, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$captureDefault.getType().isSubtypeOf(_Modifier)) { throw new IllegalArgumentException("Expected " + _Modifier + " but got " + $captureDefault.getType() + " for $captureDefault:" + $captureDefault); @@ -4059,13 +4057,13 @@ public IConstructor Expression_lambda(IConstructor $captureDefault, IList $captu Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_lambda_4 , $captureDefault, $captures, $declarator, $body).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_plusAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_plusAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4078,13 +4076,13 @@ public IConstructor Expression_plusAssign(IConstructor $lhs, IConstructor $rhs, Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_plusAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_shiftRightAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_shiftRightAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4097,13 +4095,13 @@ public IConstructor Expression_shiftRightAssign(IConstructor $lhs, IConstructor Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_shiftRightAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_constCast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_constCast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$typeId.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $typeId.getType() + " for $typeId:" + $typeId); @@ -4116,7 +4114,7 @@ public IConstructor Expression_constCast(IConstructor $typeId, IConstructor $exp Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_constCast_2 , $typeId, $expression).asWithKeywordParameters().setParameters(kwParams); @@ -4156,7 +4154,7 @@ public IConstructor Expression_arrayDesignator(IConstructor $subscript, ISourceL return vf.constructor(_Expression_arrayDesignator_1 , $subscript).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_compoundStatementExpression(IConstructor $compoundStatement, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_compoundStatementExpression(IConstructor $compoundStatement, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$compoundStatement.getType().isSubtypeOf(_Statement)) { throw new IllegalArgumentException("Expected " + _Statement + " but got " + $compoundStatement.getType() + " for $compoundStatement:" + $compoundStatement); @@ -4165,13 +4163,13 @@ public IConstructor Expression_compoundStatementExpression(IConstructor $compoun Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_compoundStatementExpression_1 , $compoundStatement).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_hasNothrowCopy(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_hasNothrowCopy(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4180,7 +4178,7 @@ public IConstructor Expression_hasNothrowCopy(IConstructor $expression, ISourceL Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_hasNothrowCopy_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -4216,7 +4214,7 @@ public IConstructor Expression_integerLiteral(IValue $number, ISourceLocation $l return vf.constructor(_Expression_integerLiteral_1 , $number).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_pmDot(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_pmDot(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4229,13 +4227,13 @@ public IConstructor Expression_pmDot(IConstructor $lhs, IConstructor $rhs, ISour Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_pmDot_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_logicalOr(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_logicalOr(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4248,13 +4246,13 @@ public IConstructor Expression_logicalOr(IConstructor $lhs, IConstructor $rhs, I Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_logicalOr_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_bracketed(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_bracketed(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4263,13 +4261,13 @@ public IConstructor Expression_bracketed(IConstructor $expression, ISourceLocati Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_bracketed_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_pmArrow(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_pmArrow(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4282,13 +4280,13 @@ public IConstructor Expression_pmArrow(IConstructor $lhs, IConstructor $rhs, ISo Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_pmArrow_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_prefixIncr(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_prefixIncr(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4297,13 +4295,13 @@ public IConstructor Expression_prefixIncr(IConstructor $expression, ISourceLocat Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_prefixIncr_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_throw(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_throw(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4312,13 +4310,13 @@ public IConstructor Expression_throw(IConstructor $expression, ISourceLocation $ Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_throw_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_typeIdInitializerExpression(IConstructor $typeId, IConstructor $initializer, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_typeIdInitializerExpression(IConstructor $typeId, IConstructor $initializer, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$typeId.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $typeId.getType() + " for $typeId:" + $typeId); @@ -4331,13 +4329,13 @@ public IConstructor Expression_typeIdInitializerExpression(IConstructor $typeId, Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_typeIdInitializerExpression_2 , $typeId, $initializer).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isUnion(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isUnion(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4346,7 +4344,7 @@ public IConstructor Expression_isUnion(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isUnion_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -4369,7 +4367,7 @@ public IConstructor Expression_arrayModifier(IList $modifiers, IList $attributes return vf.constructor(_Expression_arrayModifier_1 , $modifiers).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_logicalAnd(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_logicalAnd(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4382,24 +4380,24 @@ public IConstructor Expression_logicalAnd(IConstructor $lhs, IConstructor $rhs, Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_logicalAnd_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_this(ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_this(ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_this_0 ).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_postfixDecr(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_postfixDecr(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4408,13 +4406,13 @@ public IConstructor Expression_postfixDecr(IConstructor $expression, ISourceLoca Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_postfixDecr_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_hasTrivialCopy(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_hasTrivialCopy(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4423,13 +4421,13 @@ public IConstructor Expression_hasTrivialCopy(IConstructor $expression, ISourceL Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_hasTrivialCopy_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_assign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_assign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4442,7 +4440,7 @@ public IConstructor Expression_assign(IConstructor $lhs, IConstructor $rhs, ISou Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_assign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); @@ -4463,7 +4461,7 @@ public IConstructor Expression_new(IConstructor $typeId, ISourceLocation $loc, I return vf.constructor(_Expression_new_1 , $typeId).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_hasTrivialConstructor(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_hasTrivialConstructor(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4472,13 +4470,13 @@ public IConstructor Expression_hasTrivialConstructor(IConstructor $expression, I Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_hasTrivialConstructor_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_expressionList(IList $expressions, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_expressionList(IList $expressions, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expressions.getType().isSubtypeOf(tf.listType(_Expression))) { throw new IllegalArgumentException("Expected " + tf.listType(_Expression) + " but got " + $expressions.getType() + " for $expressions:" + $expressions); @@ -4487,13 +4485,13 @@ public IConstructor Expression_expressionList(IList $expressions, ISourceLocatio Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_expressionList_1 , $expressions).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isEnum(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isEnum(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4502,13 +4500,13 @@ public IConstructor Expression_isEnum(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isEnum_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_delete(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_delete(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4517,13 +4515,13 @@ public IConstructor Expression_delete(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_delete_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_sizeofParameterPack(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_sizeofParameterPack(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4532,13 +4530,13 @@ public IConstructor Expression_sizeofParameterPack(IConstructor $expression, ISo Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_sizeofParameterPack_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_hasVirtualDestructor(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_hasVirtualDestructor(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4547,7 +4545,7 @@ public IConstructor Expression_hasVirtualDestructor(IConstructor $expression, IS Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_hasVirtualDestructor_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -4568,7 +4566,7 @@ public IConstructor Expression_captureByRef(IConstructor $name, ISourceLocation return vf.constructor(_Expression_captureByRef_1 , $name).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_postfixIncr(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_postfixIncr(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4577,7 +4575,7 @@ public IConstructor Expression_postfixIncr(IConstructor $expression, ISourceLoca Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_postfixIncr_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -4598,7 +4596,7 @@ public IConstructor Expression_fieldDesignator(IConstructor $fieldName, ISourceL return vf.constructor(_Expression_fieldDesignator_1 , $fieldName).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_multiply(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_multiply(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4611,13 +4609,13 @@ public IConstructor Expression_multiply(IConstructor $lhs, IConstructor $rhs, IS Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_multiply_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_floatConstant(String $value, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_floatConstant(String $value, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!vf.string($value).getType().isSubtypeOf(tf.stringType())) { throw new IllegalArgumentException("Expected " + tf.stringType() + " but got " + vf.string($value).getType() + " for vf.string($value):" + vf.string($value)); @@ -4626,13 +4624,13 @@ public IConstructor Expression_floatConstant(String $value, ISourceLocation $loc Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_floatConstant_1 , vf.string($value)).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_hasNothrowConstructor(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_hasNothrowConstructor(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4641,13 +4639,13 @@ public IConstructor Expression_hasNothrowConstructor(IConstructor $expression, I Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_hasNothrowConstructor_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_binaryOr(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_binaryOr(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4660,13 +4658,13 @@ public IConstructor Expression_binaryOr(IConstructor $lhs, IConstructor $rhs, IS Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_binaryOr_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_max(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_max(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4679,13 +4677,13 @@ public IConstructor Expression_max(IConstructor $lhs, IConstructor $rhs, ISource Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_max_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_conditional(IConstructor $condition, IConstructor $positive, IConstructor $negative, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_conditional(IConstructor $condition, IConstructor $positive, IConstructor $negative, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$condition.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $condition.getType() + " for $condition:" + $condition); @@ -4702,13 +4700,13 @@ public IConstructor Expression_conditional(IConstructor $condition, IConstructor Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_conditional_3 , $condition, $positive, $negative).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_binaryAndAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_binaryAndAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4721,13 +4719,13 @@ public IConstructor Expression_binaryAndAssign(IConstructor $lhs, IConstructor $ Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_binaryAndAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isClass(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isClass(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4736,13 +4734,13 @@ public IConstructor Expression_isClass(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isClass_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_globalDelete(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_globalDelete(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4751,13 +4749,13 @@ public IConstructor Expression_globalDelete(IConstructor $expression, ISourceLoc Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_globalDelete_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_moduloAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_moduloAssign(IConstructor $lhs, IConstructor $rhs, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$lhs.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $lhs.getType() + " for $lhs:" + $lhs); @@ -4770,13 +4768,13 @@ public IConstructor Expression_moduloAssign(IConstructor $lhs, IConstructor $rhs Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_moduloAssign_2 , $lhs, $rhs).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_packExpansion(IConstructor $pattern, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_packExpansion(IConstructor $pattern, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$pattern.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $pattern.getType() + " for $pattern:" + $pattern); @@ -4785,13 +4783,13 @@ public IConstructor Expression_packExpansion(IConstructor $pattern, ISourceLocat Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_packExpansion_1 , $pattern).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_staticCast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_staticCast(IConstructor $typeId, IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$typeId.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $typeId.getType() + " for $typeId:" + $typeId); @@ -4804,13 +4802,13 @@ public IConstructor Expression_staticCast(IConstructor $typeId, IConstructor $ex Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_staticCast_2 , $typeId, $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_integerConstant(String $value, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_integerConstant(String $value, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!vf.string($value).getType().isSubtypeOf(tf.stringType())) { throw new IllegalArgumentException("Expected " + tf.stringType() + " but got " + vf.string($value).getType() + " for vf.string($value):" + vf.string($value)); @@ -4819,13 +4817,13 @@ public IConstructor Expression_integerConstant(String $value, ISourceLocation $l Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_integerConstant_1 , vf.string($value)).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_vectoredDelete(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_vectoredDelete(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4834,13 +4832,13 @@ public IConstructor Expression_vectoredDelete(IConstructor $expression, ISourceL Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_vectoredDelete_1 , $expression).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isFinal(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isFinal(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4849,7 +4847,7 @@ public IConstructor Expression_isFinal(IConstructor $expression, ISourceLocation Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isFinal_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -4870,7 +4868,7 @@ public IConstructor Expression_idExpression(IConstructor $name, ISourceLocation return vf.constructor(_Expression_idExpression_1 , $name).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isPolymorphic(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isPolymorphic(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4879,7 +4877,7 @@ public IConstructor Expression_isPolymorphic(IConstructor $expression, ISourceLo Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isPolymorphic_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -4915,7 +4913,7 @@ public IConstructor Expression_problemExpression(ISourceLocation $loc, boolean $ return vf.constructor(_Expression_problemExpression_0 ).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor Expression_isAbstract(IConstructor $expression, ISourceLocation $loc, IConstructor $typ, boolean $isMacroExpansion) { + public IConstructor Expression_isAbstract(IConstructor $expression, ISourceLocation $loc, ISourceLocation $decl, IConstructor $typ, boolean $isMacroExpansion) { if (!$expression.getType().isSubtypeOf(_Expression)) { throw new IllegalArgumentException("Expected " + _Expression + " but got " + $expression.getType() + " for $expression:" + $expression); @@ -4924,7 +4922,7 @@ public IConstructor Expression_isAbstract(IConstructor $expression, ISourceLocat Map kwParams = new HashMap(); kwParams.put("src", $loc); - + if ($decl != null) { kwParams.put("decl", $decl); } kwParams.put("typ", $typ); if ($isMacroExpansion) kwParams.put("isMacroExpansion", vf.bool(true)); return vf.constructor(_Expression_isAbstract_1 , $expression).asWithKeywordParameters().setParameters(kwParams); @@ -6272,6 +6270,21 @@ public IConstructor TypeSymbol_eUnionTemplate(ISourceLocation $decl, IList $temp return vf.constructor(_TypeSymbol_eUnionTemplate_2 , $decl, $templateParameters).asWithKeywordParameters().setParameters(kwParams); } + public IConstructor TypeSymbol_class(ISourceLocation $decl) { + + if (!$decl.getType().isSubtypeOf(tf.sourceLocationType())) { + throw new IllegalArgumentException("Expected " + tf.sourceLocationType() + " but got " + $decl.getType() + " for $decl:" + $decl); + } + + Map kwParams = new HashMap(); + + + + + + return vf.constructor(_TypeSymbol_class_1 , $decl).asWithKeywordParameters().setParameters(kwParams); + } + public IConstructor TypeSymbol___nullType() { Map kwParams = new HashMap(); @@ -6794,40 +6807,6 @@ public IConstructor TypeSymbol_functionSetType(ISourceLocation $decl, IList $tem return vf.constructor(_TypeSymbol_functionSetType_2 , $decl, $templateArguments).asWithKeywordParameters().setParameters(kwParams); } - public IConstructor TypeSymbol_unaryTypeTransformation(String $operator, IConstructor $operand) { - - if (!vf.string($operator).getType().isSubtypeOf(tf.stringType())) { - throw new IllegalArgumentException("Expected " + tf.stringType() + " but got " + vf.string($operator).getType() + " for vf.string($operator):" + vf.string($operator)); - } - - if (!$operand.getType().isSubtypeOf(_TypeSymbol)) { - throw new IllegalArgumentException("Expected " + _TypeSymbol + " but got " + $operand.getType() + " for $operand:" + $operand); - } - - Map kwParams = new HashMap(); - - - - - - return vf.constructor(_TypeSymbol_unaryTypeTransformation_2 , vf.string($operator), $operand).asWithKeywordParameters().setParameters(kwParams); - } - - public IConstructor TypeSymbol_class(ISourceLocation $decl) { - - if (!$decl.getType().isSubtypeOf(tf.sourceLocationType())) { - throw new IllegalArgumentException("Expected " + tf.sourceLocationType() + " but got " + $decl.getType() + " for $decl:" + $decl); - } - - Map kwParams = new HashMap(); - - - - - - return vf.constructor(_TypeSymbol_class_1 , $decl).asWithKeywordParameters().setParameters(kwParams); - } - public IConstructor TypeSymbol_typeOfDependentExpression(String $name) { if (!vf.string($name).getType().isSubtypeOf(tf.stringType())) { diff --git a/src/lang/cpp/internal/BindingsResolver.java b/src/lang/cpp/internal/BindingsResolver.java index 6c5a6e43..6300ab9e 100644 --- a/src/lang/cpp/internal/BindingsResolver.java +++ b/src/lang/cpp/internal/BindingsResolver.java @@ -716,7 +716,7 @@ else if (binding.getName().startsWith("~")) { private boolean isOperatorName(String name) { if (name.startsWith("operator")) { - if (name.contains("[<>\\-+*/=%!&\\|\\^\\?\\.\\[\\]]")) { + if (name.matches("[<>\\-+*/=%!&\\|\\^\\?\\.\\[\\]]")) { return true; } diff --git a/src/lang/cpp/internal/Parser.java b/src/lang/cpp/internal/Parser.java index 81f23c64..42d47ac3 100644 --- a/src/lang/cpp/internal/Parser.java +++ b/src/lang/cpp/internal/Parser.java @@ -14,8 +14,6 @@ import java.io.PrintWriter; import java.net.URISyntaxException; -import java.time.Duration; -import java.time.Instant; import java.util.HashSet; import java.util.Set; import java.util.Stack; @@ -178,6 +176,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVirtSpecifier; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTWhileStatement; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; import org.eclipse.cdt.core.dom.ast.gnu.IGCCASTAttributeList; import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTGotoStatement; @@ -2680,7 +2679,7 @@ private int visit(CASTArraySubscriptExpression expression) { expression.getArgument().accept(this); IConstructor argument = stack.pop(); - stack.push(builder.Expression_arraySubscriptExpression(arrayExpression, argument, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_arraySubscriptExpression(arrayExpression, argument, loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -2696,7 +2695,7 @@ private int visit(ICPPASTArraySubscriptExpression expression) { expression.getArgument().accept(this); IConstructor argument = stack.pop(); - stack.push(builder.Expression_arraySubscriptExpression(arrayExpression, argument, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_arraySubscriptExpression(arrayExpression, argument, loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -2720,17 +2719,18 @@ private int visit(ICPPASTDeleteExpression expression) { ISourceLocation loc = locs.forNode(expression); boolean isMacroExpansion = isMacroExpansion(expression); IConstructor typ = tr.resolveType(expression); + expression.getOperand().accept(this); if (expression.isGlobal()) { if (expression.isVectored()) - stack.push(builder.Expression_globalVectoredDelete(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_globalVectoredDelete(stack.pop(), loc, null, typ, isMacroExpansion)); else - stack.push(builder.Expression_globalDelete(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_globalDelete(stack.pop(), loc, null, typ, isMacroExpansion)); } else { if (expression.isVectored()) - stack.push(builder.Expression_vectoredDelete(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_vectoredDelete(stack.pop(), loc, null, typ, isMacroExpansion)); else - stack.push(builder.Expression_delete(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_delete(stack.pop(), loc, null, typ, isMacroExpansion)); } return PROCESS_ABORT; } @@ -2788,17 +2788,17 @@ private int visit(ICPPASTLambdaExpression expression) { case BY_COPY: stack.push(builder.Expression_lambda( builder.Modifier_captDefByCopy(getTokenSourceLocation(expression, "="), isMacroExpansion), - captures.done(), declarator, body, loc, typ, isMacroExpansion)); + captures.done(), declarator, body, loc, null, typ, isMacroExpansion)); break; case BY_REFERENCE: stack.push(builder.Expression_lambda( builder.Modifier_captDefByReference(getTokenSourceLocation(expression, "&"), isMacroExpansion), - captures.done(), declarator, body, loc, typ, isMacroExpansion)); + captures.done(), declarator, body, loc, null, typ, isMacroExpansion)); break; case UNSPECIFIED: stack.push(builder.Expression_lambda( builder.Modifier_captDefUnspecified(vf.sourceLocation(loc, loc.getOffset(), 0), isMacroExpansion), - captures.done(), declarator, body, loc, typ, isMacroExpansion)); + captures.done(), declarator, body, loc, null, typ, isMacroExpansion)); break; default: throw new RuntimeException("Unknown default capture type " + captureDefault + " encountered at " @@ -2827,10 +2827,10 @@ private int visit(ICPPASTNaryTypeIdExpression expression) { }); switch (expression.getOperator()) { case __is_constructible: - stack.push(builder.Expression_isConstructable(args.done(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isConstructable(args.done(), loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; case __is_trivially_constructible: - stack.push(builder.Expression_isTriviallyConstructable(args.done(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isTriviallyConstructable(args.done(), loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; default: throw new RuntimeException("Operator " + expression.getOperator() + " unknown at " + loc + ", exiting"); @@ -2937,7 +2937,7 @@ private int visit(ICPPASTPackExpansionExpression expression) { boolean isMacroExpansion = isMacroExpansion(expression); IConstructor typ = tr.resolveType(expression); expression.getPattern().accept(this); - stack.push(builder.Expression_packExpansion(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_packExpansion(stack.pop(), loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -2952,7 +2952,7 @@ private int visit(ICPPASTSimpleTypeConstructorExpression expression) { expression.getInitializer().accept(this); IConstructor initializer = stack.pop(); - stack.push(builder.Expression_simpleTypeConstructor(declSpecifier, initializer, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_simpleTypeConstructor(declSpecifier, initializer, loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -2983,7 +2983,7 @@ private int visit(CASTCompoundStatementExpression expression) { typ = builder.TypeSymbol_any(); } expression.getCompoundStatement().accept(this); - stack.push(builder.Expression_compoundStatementExpression(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_compoundStatementExpression(stack.pop(), loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -3000,7 +3000,7 @@ private int visit(CPPASTCompoundStatementExpression expression) { typ = builder.TypeSymbol_any(); } expression.getCompoundStatement().accept(this); - stack.push(builder.Expression_compoundStatementExpression(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_compoundStatementExpression(stack.pop(), loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -3026,108 +3026,120 @@ private int visit(IASTBinaryExpression expression) { expression.getInitOperand2().accept(this); IConstructor rhs = stack.pop(); + ISourceLocation decl = null; + + if (expression instanceof ICPPASTBinaryExpression) { + // C++ operators can be overloaded, we want to know which ones we are using + ICPPASTBinaryExpression cppe = (ICPPASTBinaryExpression) expression; + ICPPFunction overload = cppe.getOverload(); + + if (overload != null) { + decl = br.resolveBinding(overload, loc); + } + } + switch (expression.getOperator()) { case IASTBinaryExpression.op_multiply: - stack.push(builder.Expression_multiply(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_multiply(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_divide: - stack.push(builder.Expression_divide(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_divide(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_modulo: - stack.push(builder.Expression_modulo(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_modulo(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_plus: - stack.push(builder.Expression_plus(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_plus(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_minus: - stack.push(builder.Expression_minus(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_minus(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_shiftLeft: - stack.push(builder.Expression_shiftLeft(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_shiftLeft(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_shiftRight: - stack.push(builder.Expression_shiftRight(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_shiftRight(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_lessThan: - stack.push(builder.Expression_lessThan(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_lessThan(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_greaterThan: - stack.push(builder.Expression_greaterThan(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_greaterThan(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_lessEqual: - stack.push(builder.Expression_lessEqual(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_lessEqual(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_greaterEqual: - stack.push(builder.Expression_greaterEqual(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_greaterEqual(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_binaryAnd: - stack.push(builder.Expression_binaryAnd(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_binaryAnd(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_binaryXor: - stack.push(builder.Expression_binaryXor(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_binaryXor(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_binaryOr: - stack.push(builder.Expression_binaryOr(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_binaryOr(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_logicalAnd: - stack.push(builder.Expression_logicalAnd(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_logicalAnd(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_logicalOr: - stack.push(builder.Expression_logicalOr(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_logicalOr(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_assign: - stack.push(builder.Expression_assign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_assign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_multiplyAssign: - stack.push(builder.Expression_multiplyAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_multiplyAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_divideAssign: - stack.push(builder.Expression_divideAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_divideAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_moduloAssign: - stack.push(builder.Expression_moduloAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_moduloAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_plusAssign: - stack.push(builder.Expression_plusAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_plusAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_minusAssign: - stack.push(builder.Expression_minusAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_minusAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_shiftLeftAssign: - stack.push(builder.Expression_shiftLeftAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_shiftLeftAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_shiftRightAssign: - stack.push(builder.Expression_shiftRightAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_shiftRightAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_binaryAndAssign: - stack.push(builder.Expression_binaryAndAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_binaryAndAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_binaryXorAssign: - stack.push(builder.Expression_binaryXorAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_binaryXorAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_binaryOrAssign: - stack.push(builder.Expression_binaryOrAssign(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_binaryOrAssign(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_equals: - stack.push(builder.Expression_equals(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_equals(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_notequals: - stack.push(builder.Expression_notEquals(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_notEquals(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_pmdot: - stack.push(builder.Expression_pmDot(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_pmDot(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_pmarrow: - stack.push(builder.Expression_pmArrow(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_pmArrow(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_max: - stack.push(builder.Expression_max(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_max(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_min: - stack.push(builder.Expression_min(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_min(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; case IASTBinaryExpression.op_ellipses: - stack.push(builder.Expression_ellipses(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_ellipses(lhs, rhs, loc, decl, typ, isMacroExpansion)); break; default: throw new RuntimeException("Operator " + expression.getOperator() + " unknown at " + loc + ", exiting"); @@ -3149,10 +3161,10 @@ private int visit(IASTBinaryTypeIdExpression expression) { switch (expression.getOperator()) { case __is_base_of: - stack.push(builder.Expression_isBaseOf(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isBaseOf(lhs, rhs, loc, null, typ, isMacroExpansion)); break; case __is_trivially_assignable: - stack.push(builder.Expression_isTriviallyAssignable(lhs, rhs, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isTriviallyAssignable(lhs, rhs, loc, null, typ, isMacroExpansion)); break; default: throw new RuntimeException( @@ -3175,19 +3187,19 @@ private int visit(IASTCastExpression expression) { switch (expression.getOperator()) { case ICPPASTCastExpression.op_cast: - stack.push(builder.Expression_cast(type, operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_cast(type, operand, loc, null, typ, isMacroExpansion)); break; case ICPPASTCastExpression.op_dynamic_cast: - stack.push(builder.Expression_dynamicCast(type, operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_dynamicCast(type, operand, loc, null, typ, isMacroExpansion)); break; case ICPPASTCastExpression.op_static_cast: - stack.push(builder.Expression_staticCast(type, operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_staticCast(type, operand, loc, null, typ, isMacroExpansion)); break; case ICPPASTCastExpression.op_reinterpret_cast: - stack.push(builder.Expression_reinterpretCast(type, operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_reinterpretCast(type, operand, loc, null, typ, isMacroExpansion)); break; case ICPPASTCastExpression.op_const_cast: - stack.push(builder.Expression_constCast(type, operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_constCast(type, operand, loc, null, typ, isMacroExpansion)); break; default: throw new RuntimeException("Unknown cast type " + expression.getOperator() + " at " + loc); @@ -3210,10 +3222,10 @@ private int visit(IASTConditionalExpression expression) { if (positiveResultExpression != null) { positiveResultExpression.accept(this); IConstructor positive = stack.pop(); - stack.push(builder.Expression_conditional(condition, positive, negative, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_conditional(condition, positive, negative, loc, null, typ, isMacroExpansion)); } else {// GNU extension: `?:` - stack.push(builder.Expression_conditional(condition, negative, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_conditional(condition, negative, loc, null, typ, isMacroExpansion)); } return PROCESS_ABORT; @@ -3229,7 +3241,7 @@ private int visit(IASTExpressionList expression) { it.accept(this); expressions.append(stack.pop()); }); - stack.push(builder.Expression_expressionList(expressions.done(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_expressionList(expressions.done(), loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -3273,6 +3285,17 @@ private int visit(IASTFunctionCallExpression expression) { ISourceLocation loc = locs.forNode(expression); boolean isMacroExpansion = isMacroExpansion(expression); IConstructor typ = tr.resolveType(expression); + ISourceLocation decl = null; + + // call syntax can be overloaded, register where we are resolving to here + if (expression instanceof ICPPASTFunctionCallExpression) { + ICPPASTFunctionCallExpression cppe = (ICPPASTFunctionCallExpression) expression; + ICPPFunction overload = cppe.getOverload(); + + if (overload != null) { + decl = br.resolveBinding(overload, loc); + } + } expression.getFunctionNameExpression().accept(this); IConstructor functionName = stack.pop(); @@ -3282,7 +3305,7 @@ private int visit(IASTFunctionCallExpression expression) { it.accept(this); arguments.append(stack.pop()); }); - stack.push(builder.Expression_functionCall(functionName, arguments.done(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_functionCall(functionName, arguments.done(), loc, decl, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -3302,32 +3325,33 @@ private int visit(IASTLiteralExpression expression) { ISourceLocation loc = locs.forNode(expression); boolean isMacroExpansion = isMacroExpansion(expression); IConstructor typ = tr.resolveType(expression); + ISourceLocation decl = null; // TODO: could literal syntax be overloaded? String value = new String(expression.getValue()); switch (expression.getKind()) { case IASTLiteralExpression.lk_integer_constant: - stack.push(builder.Expression_integerConstant(value, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_integerConstant(value, loc, decl, typ, isMacroExpansion)); break; case IASTLiteralExpression.lk_float_constant: - stack.push(builder.Expression_floatConstant(value, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_floatConstant(value, loc, decl, typ, isMacroExpansion)); break; case IASTLiteralExpression.lk_char_constant: - stack.push(builder.Expression_charConstant(value, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_charConstant(value, loc, decl, typ, isMacroExpansion)); break; case IASTLiteralExpression.lk_string_literal: - stack.push(builder.Expression_stringLiteral(value, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_stringLiteral(value, loc, decl, typ, isMacroExpansion)); break; case IASTLiteralExpression.lk_this: - stack.push(builder.Expression_this(loc, typ, isMacroExpansion)); + stack.push(builder.Expression_this(loc, decl, typ, isMacroExpansion)); break; case IASTLiteralExpression.lk_true: - stack.push(builder.Expression_true(loc, typ, isMacroExpansion)); + stack.push(builder.Expression_true(loc, decl, typ, isMacroExpansion)); break; case IASTLiteralExpression.lk_false: - stack.push(builder.Expression_false(loc, typ, isMacroExpansion)); + stack.push(builder.Expression_false(loc, decl, typ, isMacroExpansion)); break; case IASTLiteralExpression.lk_nullptr: - stack.push(builder.Expression_nullptr(loc, typ, isMacroExpansion)); + stack.push(builder.Expression_nullptr(loc, decl, typ, isMacroExpansion)); break; default: throw new RuntimeException( @@ -3355,7 +3379,7 @@ private int visit(IASTTypeIdInitializerExpression expression) { expression.getTypeId().accept(this); IConstructor typeId = stack.pop(); expression.getInitializer().accept(this); - stack.push(builder.Expression_typeIdInitializerExpression(typeId, stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_typeIdInitializerExpression(typeId, stack.pop(), loc, null, typ, isMacroExpansion)); return PROCESS_ABORT; } @@ -3368,79 +3392,79 @@ private int visit(IASTTypeIdExpression expression) { expression.getTypeId().accept(this); switch (expression.getOperator()) { case IASTTypeIdExpression.op_sizeof: - stack.push(builder.Expression_sizeof(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_sizeof(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_typeid: - stack.push(builder.Expression_typeid(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_typeid(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_alignof: // gnu-only? - stack.push(builder.Expression_alignOf(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_alignOf(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_typeof: - stack.push(builder.Expression_typeof(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_typeof(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_has_nothrow_assign: - stack.push(builder.Expression_hasNothrowAssign(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_hasNothrowAssign(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_has_nothrow_copy: - stack.push(builder.Expression_hasNothrowCopy(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_hasNothrowCopy(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_has_nothrow_constructor: - stack.push(builder.Expression_hasNothrowConstructor(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_hasNothrowConstructor(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_has_trivial_assign: - stack.push(builder.Expression_hasTrivialAssign(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_hasTrivialAssign(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_has_trivial_constructor: - stack.push(builder.Expression_hasTrivialConstructor(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_hasTrivialConstructor(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_has_trivial_copy: - stack.push(builder.Expression_hasTrivialCopy(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_hasTrivialCopy(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_has_trivial_destructor: - stack.push(builder.Expression_hasTrivialDestructor(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_hasTrivialDestructor(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_has_virtual_destructor: - stack.push(builder.Expression_hasVirtualDestructor(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_hasVirtualDestructor(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_abstract: - stack.push(builder.Expression_isAbstract(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isAbstract(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_class: - stack.push(builder.Expression_isClass(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isClass(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_empty: - stack.push(builder.Expression_isEmpty(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isEmpty(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_enum: - stack.push(builder.Expression_isEnum(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isEnum(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_pod: - stack.push(builder.Expression_isPod(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isPod(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_polymorphic: - stack.push(builder.Expression_isPolymorphic(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isPolymorphic(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_union: - stack.push(builder.Expression_isUnion(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isUnion(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_literal_type: - stack.push(builder.Expression_isLiteralType(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isLiteralType(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_standard_layout: - stack.push(builder.Expression_isStandardLayout(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isStandardLayout(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_trivial: - stack.push(builder.Expression_isTrivial(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isTrivial(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_sizeofParameterPack: - stack.push(builder.Expression_sizeofParameterPack(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_sizeofParameterPack(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_final: - stack.push(builder.Expression_isFinal(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isFinal(stack.pop(), loc, null, typ, isMacroExpansion)); break; case IASTTypeIdExpression.op_is_trivially_copyable: - stack.push(builder.Expression_isTriviallyCopyable(stack.pop(), loc, typ, isMacroExpansion)); + stack.push(builder.Expression_isTriviallyCopyable(stack.pop(), loc, null, typ, isMacroExpansion)); break; default: throw new RuntimeException("ERROR: IASTTypeIdExpression called with unimplemented/unknown operator " @@ -3454,6 +3478,7 @@ private int visit(IASTUnaryExpression expression) { ISourceLocation loc = locs.forNode(expression); boolean isMacroExpansion = isMacroExpansion(expression); IConstructor typ = tr.resolveType(expression); + ISourceLocation decl = null; IConstructor operand = null; if (expression.getOperand() != null) { @@ -3461,64 +3486,73 @@ private int visit(IASTUnaryExpression expression) { operand = stack.pop(); } + if (expression instanceof ICPPASTUnaryExpression) { + ICPPASTUnaryExpression cppe = (ICPPASTUnaryExpression) expression; + ICPPFunction overload = cppe.getOverload(); + + if (overload != null) { + decl = br.resolveBinding(overload, loc); + } + } + switch (expression.getOperator()) { case IASTUnaryExpression.op_prefixIncr: - stack.push(builder.Expression_prefixIncr(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_prefixIncr(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_prefixDecr: - stack.push(builder.Expression_prefixDecr(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_prefixDecr(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_plus: - stack.push(builder.Expression_plus(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_plus(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_minus: - stack.push(builder.Expression_minus(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_minus(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_star: - stack.push(builder.Expression_star(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_star(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_amper: - stack.push(builder.Expression_amper(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_amper(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_tilde: - stack.push(builder.Expression_tilde(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_tilde(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_not: - stack.push(builder.Expression_not(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_not(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_sizeof: - stack.push(builder.Expression_sizeof(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_sizeof(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_postFixIncr: - stack.push(builder.Expression_postfixIncr(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_postfixIncr(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_postFixDecr: - stack.push(builder.Expression_postfixDecr(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_postfixDecr(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_bracketedPrimary: - stack.push(builder.Expression_bracketed(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_bracketed(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_throw: if (operand == null) - stack.push(builder.Expression_throw(loc, typ, isMacroExpansion)); + stack.push(builder.Expression_throw(loc, decl, typ, isMacroExpansion)); else - stack.push(builder.Expression_throw(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_throw(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_typeid: - stack.push(builder.Expression_typeid(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_typeid(operand, loc, decl, typ, isMacroExpansion)); break; // case IASTUnaryExpression.op_typeof: (14) typeOf is deprecated case IASTUnaryExpression.op_alignOf: - stack.push(builder.Expression_alignOf(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_alignOf(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_sizeofParameterPack: - stack.push(builder.Expression_sizeofParameterPack(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_sizeofParameterPack(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_noexcept: - stack.push(builder.Expression_noexcept(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_noexcept(operand, loc, decl, typ, isMacroExpansion)); break; case IASTUnaryExpression.op_labelReference: - stack.push(builder.Expression_labelReference(operand, loc, typ, isMacroExpansion)); + stack.push(builder.Expression_labelReference(operand, loc, decl, typ, isMacroExpansion)); break; default: throw new RuntimeException( diff --git a/src/lang/cpp/internal/TypeResolver.java b/src/lang/cpp/internal/TypeResolver.java index 264f371b..f9945c7a 100644 --- a/src/lang/cpp/internal/TypeResolver.java +++ b/src/lang/cpp/internal/TypeResolver.java @@ -43,7 +43,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclarator; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamedTypeSpecifier; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration; @@ -69,9 +68,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTypeSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPUnaryTypeTransformation; -import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNaryTypeIdExpression.Operator; import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer; -import org.eclipse.cdt.internal.core.dom.parser.c.CASTFunctionDeclarator; import org.eclipse.cdt.internal.core.dom.parser.c.CStructure; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitTemplateTypeParameter; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateNonTypeArgument;