| 1156 | | _RewriteFnApp(Expr function, Expr argument); |
| 1157 | | /** |
| 1158 | | * expression using operators |
| 1159 | | * (list of ops allows cross-API overloading) |
| 1160 | | * OpExpr ::= EncloserOp OpExpr? EncloserOp? |
| 1161 | | * | OpExpr EncloserOp OpExpr? |
| 1162 | | * | Primary |
| 1163 | | * EncloserOp ::= Encloser |
| 1164 | | * | Op |
| 1165 | | * Primary ::= LeftEncloser ExprList? RightEncloser |
| 1166 | | * | Primary ^ Exponent |
| 1167 | | * | Primary ExponentOp |
| 1168 | | * e.g.) 3 + 5 |
| 1169 | | */ |
| 1170 | | OpExpr(OpRef op, |
| 1171 | | List<Expr> args = Collections.<Expr>emptyList()); |
| 1172 | | |
| 1173 | | /** |
| 1174 | | * If an expression uses and operator, and that operator |
| 1175 | | * looks at parse-time like a multifix operator, it |
| 1176 | | * an AmbigMultifixOpExpr node is created, because it is |
| 1177 | | * unclear until typechecking and overloading resolution |
| 1178 | | * whether it should be one multifix application or several |
| 1179 | | * infix applications. |
| 1180 | | * |
| 1181 | | * e.g.) 3+4+5+6 |
| 1182 | | */ |
| 1183 | | AmbiguousMultifixOpExpr(OpRef infix_op, OpRef multifix_op, |
| 1184 | | List<Expr> args = Collections.<Expr>emptyList()); |
| 1185 | | |
| 1186 | | /** |
| 1187 | | * chain expression |
| 1188 | | * Certain infix mathematical operators that are |
| 1189 | | * traditionally regarded as relational operators, |
| 1190 | | * delivering boolean results, may be chained. |
| 1191 | | * e.g.) A SUBSETEQ B SUBSET C SUBSETEQ D |
| 1192 | | */ |
| 1193 | | ChainExpr(Expr first, List<Link> links); |
| 1194 | | /** |
| 1195 | | * coercion invocation |
| 1196 | | * internal node created by static analysis |
| 1197 | | * after inferring the implicit coercion invocations |
| 1198 | | */ |
| 1199 | | CoercionInvocation(BaseType type, |
| 1200 | | List<StaticArg> staticArgs |
| 1201 | | = Collections.<StaticArg>emptyList(), |
| 1202 | | Expr arg); |
| 1203 | | /** |
| 1204 | | * a method invocation |
| 1205 | | * some are created by parsing, while others require later |
| 1206 | | * static analysis to disambiguate from function applications |
| 1207 | | * |
| 1208 | | * Names of "method" must be unqualified. |
| 1209 | | * e.g.) myString.toUppercase() |
| 1210 | | */ |
| 1211 | | MethodInvocation(Expr obj, Id method, |
| 1212 | | List<StaticArg> staticArgs |
| 1213 | | = Collections.<StaticArg>emptyList(), |
| 1214 | | Expr arg); |
| | 1145 | TightJuxt(boolean fnApp = false); |
| | 1146 | /** |
| | 1147 | * functional application |
| | 1148 | * Primary ::= Primary ArgExpr |
| | 1149 | * | Primary Primary |
| | 1150 | * e.g.) x y |
| | 1151 | */ |
| | 1152 | _RewriteFnApp(Expr function, Expr argument); |
| | 1153 | /** |
| | 1154 | * expression using operators |
| | 1155 | * (list of ops allows cross-API overloading) |
| | 1156 | * OpExpr ::= EncloserOp OpExpr? EncloserOp? |
| | 1157 | * | OpExpr EncloserOp OpExpr? |
| | 1158 | * | Primary |
| | 1159 | * EncloserOp ::= Encloser |
| | 1160 | * | Op |
| | 1161 | * Primary ::= LeftEncloser ExprList? RightEncloser |
| | 1162 | * | Primary ^ Exponent |
| | 1163 | * | Primary ExponentOp |
| | 1164 | * e.g.) 3 + 5 |
| | 1165 | */ |
| | 1166 | OpExpr(OpRef op, |
| | 1167 | List<Expr> args = Collections.<Expr>emptyList()); |
| | 1168 | /** |
| | 1169 | * If an expression uses and operator, and that operator |
| | 1170 | * looks at parse-time like a multifix operator, it |
| | 1171 | * an AmbigMultifixOpExpr node is created, because it is |
| | 1172 | * unclear until typechecking and overloading resolution |
| | 1173 | * whether it should be one multifix application or several |
| | 1174 | * infix applications. |
| | 1175 | * |
| | 1176 | * e.g.) 3+4+5+6 |
| | 1177 | */ |
| | 1178 | AmbiguousMultifixOpExpr(OpRef infix_op, OpRef multifix_op, |
| | 1179 | List<Expr> args = Collections.<Expr>emptyList()); |
| | 1180 | /** |
| | 1181 | * chain expression |
| | 1182 | * Certain infix mathematical operators that are |
| | 1183 | * traditionally regarded as relational operators, |
| | 1184 | * delivering boolean results, may be chained. |
| | 1185 | * e.g.) A SUBSETEQ B SUBSET C SUBSETEQ D |
| | 1186 | */ |
| | 1187 | ChainExpr(Expr first, List<Link> links); |
| | 1188 | /** |
| | 1189 | * coercion invocation |
| | 1190 | * internal node created by static analysis |
| | 1191 | * after inferring the implicit coercion invocations |
| | 1192 | */ |
| | 1193 | CoercionInvocation(BaseType type, |
| | 1194 | List<StaticArg> staticArgs |
| | 1195 | = Collections.<StaticArg>emptyList(), |
| | 1196 | Expr arg); |
| | 1197 | /** |
| | 1198 | * a method invocation |
| | 1199 | * some are created by parsing, while others require later |
| | 1200 | * static analysis to disambiguate from function applications |
| | 1201 | * |
| | 1202 | * Names of "method" must be unqualified. |
| | 1203 | * e.g.) myString.toUppercase() |
| | 1204 | */ |
| | 1205 | MethodInvocation(Expr obj, Id method, |
| | 1206 | List<StaticArg> staticArgs |
| | 1207 | = Collections.<StaticArg>emptyList(), |
| | 1208 | Expr arg); |