| 20 | | import List.{List} |
|---|
| 21 | | |
|---|
| 22 | | (* Fortress representation of Fortress AST nodes *) |
|---|
| 23 | | trait Node |
|---|
| 24 | | toString():String |
|---|
| 25 | | end |
|---|
| 26 | | |
|---|
| 27 | | trait AbsDeclOrDecl extends Node end |
|---|
| 28 | | trait AbsDecl extends AbsDeclOrDecl end |
|---|
| 29 | | trait Decl extends AbsDeclOrDecl end |
|---|
| 30 | | trait Lhs extends AbsDeclOrDecl end |
|---|
| 31 | | |
|---|
| 32 | | trait Generic extends Node |
|---|
| 33 | | staticParam:List[\StaticParam\] |
|---|
| 34 | | end |
|---|
| 35 | | |
|---|
| 36 | | trait HasParams extends Node |
|---|
| 37 | | params:Maybe[\List[\Param\]\] |
|---|
| 38 | | decls:List[\AbsDeclOrDecl\] |
|---|
| 39 | | end |
|---|
| 40 | | |
|---|
| 41 | | trait HasWhere extends Node |
|---|
| 42 | | wheres:List[\WhereClause\] |
|---|
| 43 | | end |
|---|
| 44 | | |
|---|
| 45 | | trait ExprOrUnitExpr extends Node end |
|---|
| 46 | | |
|---|
| 47 | | trait Applicable extends { AbsDeclOrDecl } |
|---|
| 48 | | name : Id |
|---|
| 49 | | staticParams : List[\StaticParam\] |
|---|
| 50 | | params:List[\Param\] |
|---|
| 51 | | returnType:Maybe[\Type\] |
|---|
| 52 | | whereClause:List[\WhereClause\] |
|---|
| 53 | | end |
|---|
| 54 | | |
|---|
| 55 | | trait GenericWithParams extends { Generic, HasParams } end |
|---|
| 56 | | trait GenericAbsDeclOrDecl extends { Generic, AbsDeclOrDecl } end |
|---|
| 57 | | trait GenericDecl extends Decl end |
|---|
| 58 | | trait GenericAbsDeclOrDeclWithParams extends { GenericWithParams, GenericAbsDeclOrDecl } end |
|---|
| 59 | | trait GenericDeclWithParams extends GenericDecl end |
|---|
| 60 | | |
|---|
| 61 | | (* TODO: put comprises clauses on AbstractNode and all subtypes |
|---|
| 62 | | so that they can't be extended *) |
|---|
| 63 | | trait AbstractNode extends { Node } end |
|---|
| 64 | | |
|---|
| 65 | | trait CompilationUnit extends AbstractNode end |
|---|
| 66 | | object Api extends CompilationUnit end |
|---|
| 67 | | object Component extends CompilationUnit end |
|---|
| 68 | | |
|---|
| 69 | | trait Import extends AbstractNode end |
|---|
| 70 | | trait Export extends AbstractNode end |
|---|
| 71 | | |
|---|
| 72 | | (* TODO: Implement aliasedName *) |
|---|
| 73 | | |
|---|
| 74 | | (* TODO: Implement aliasedAPIName *) |
|---|
| 75 | | |
|---|
| 76 | | (* TODO: Implement traitObjectAbsDeclOrDecls *) |
|---|
| 77 | | |
|---|
| 78 | | object AbsTraitDecl extends {AbstractNode, AbsDecl} end |
|---|
| 79 | | object TraitDecl extends {AbstractNode, GenericDecl} end |
|---|
| 80 | | |
|---|
| 81 | | object AbsObjectDecl extends {AbstractNode, AbsDecl} end |
|---|
| 82 | | object ObjectDecl extends {AbstractNode, GenericDeclWithParams} end |
|---|
| 83 | | |
|---|
| 84 | | trait DimUnitDecl extends {AbstractNode, Decl, AbsDecl} end |
|---|
| 85 | | |
|---|
| 86 | | object TestDecl extends {AbstractNode, Decl, AbsDecl} end |
|---|
| 87 | | object TypeAlias extends {AbstractNode, Decl, AbsDecl} end |
|---|
| 88 | | object PropertyDecl extends {AbstractNode, Decl, AbsDecl} end |
|---|
| 89 | | |
|---|
| 90 | | trait GrammarDecl extends {AbstractNode, AbsDecl} end |
|---|
| 91 | | |
|---|
| 92 | | trait GrammarMemberDecl extends {AbstractNode, AbsDecl} end |
|---|
| 93 | | object SyntaxDef end |
|---|
| 94 | | |
|---|
| 95 | | object TransformationTemplateDef end |
|---|
| 96 | | object TransformationExpressionDef end |
|---|
| 97 | | trait BaseType end |
|---|
| 98 | | trait TransformationPreTemplateDef end |
|---|
| 99 | | |
|---|
| 100 | | trait VarAbsDeclOrDecl extends AbsDeclOrDecl |
|---|
| 101 | | lhs:List[\LValueBind\] |
|---|
| 102 | | end |
|---|
| 103 | | trait AbsVarDecl extends { AbsDecl, Decl } end |
|---|
| 104 | | object VarDecl(lhs:List[\LValueBind\], init:Expr) extends { VarAbsDeclOrDecl, Decl } end |
|---|
| 105 | | |
|---|
| 106 | | trait LValue extends AbstractNode end |
|---|
| 107 | | |
|---|
| 108 | | object LValueBind(name:Id, atype:Maybe[\Type\], mods:List[\Modifier\], mutable:Boolean) extends { LValue, Lhs } end |
|---|
| 109 | | trait Unpasting extends LValue end |
|---|
| 110 | | object UnpastingBind[\T\](name:Id, dims:List[\ExtentRange[\T\]\]) extends Unpasting end |
|---|
| 111 | | object UnpastingSplit(elems:List[\Unpasting\], dims:ZZ32) extends Unpasting end |
|---|
| 112 | | |
|---|
| 113 | | (** |
|---|
| 114 | | * functional declaration in components or APIs |
|---|
| 115 | | *) |
|---|
| 116 | | trait FnAbsDeclOrDecl extends { AbstractNode, Applicable, GenericDecl } |
|---|
| 117 | | mods:List[\Modifier\] |
|---|
| 118 | | name:Id |
|---|
| 119 | | staticParams:List[\StaticParam\] |
|---|
| 120 | | params:List[\Param\] |
|---|
| 121 | | returnType:Maybe[\Type\] |
|---|
| 122 | | throwsClause:Maybe[\List[\TraitType\]\] |
|---|
| 123 | | whereClause:WhereClause |
|---|
| 124 | | acontract:Contract |
|---|
| 125 | | selfName:String |
|---|
| 126 | | end |
|---|
| 127 | | (** |
|---|
| 128 | | * functional declaration in APIs |
|---|
| 129 | | * AbsFnDecl ::= AbsFnMods? FnHeaderFront FnHeaderClause |
|---|
| 130 | | * | FnSig |
|---|
| 131 | | * FnSig ::= Name : ArrowType |
|---|
| 132 | | * FnHeaderFront ::= Id StaticParams? ValParam |
|---|
| 133 | | * | OpHeaderFront |
|---|
| 134 | | * OpHeaderFront ::= opr StaticParams? (LeftEncloser | Encloser) Params |
|---|
| 135 | | * (RightEncloser | Encloser) |
|---|
| 136 | | * (:= ( SubscriptAssignParam ))? |
|---|
| 137 | | * | opr StaticParams? ValParam Op |
|---|
| 138 | | * | opr (Op | ExponentOp | Encloser) StaticParams? ValParam |
|---|
| 139 | | * SubscriptAssignParam ::= Varargs | Param |
|---|
| 140 | | * FnHeaderClause ::= IsType? FnClauses |
|---|
| 141 | | * FnDecl ::= FnMods? FnHeaderFront FnHeaderClause |
|---|
| 142 | | * | FnSig |
|---|
| 143 | | * e.g.) swap (x: Object, y: Object): (Object, Object) |
|---|
| 144 | | *) |
|---|
| 145 | | object AbsFnDecl(mods:List[\Modifier\], |
|---|
| 146 | | name:Id, |
|---|
| 147 | | staticParams:List[\StaticParam\], |
|---|
| 148 | | params:List[\Param\], |
|---|
| 149 | | returnType:Maybe[\Type\], |
|---|
| 150 | | throwsClause:Maybe[\List[\TraitType\]\], |
|---|
| 151 | | whereClause:WhereClause, |
|---|
| 152 | | acontract:Contract, |
|---|
| 153 | | selfName:String) extends {FnAbsDeclOrDecl, AbsDecl } end |
|---|
| 154 | | (** |
|---|
| 155 | | * functional declaration in components |
|---|
| 156 | | * FnDecl ::= FnMods? FnHeaderFront FnHeaderClause = Expr |
|---|
| 157 | | * e.g.) swap (x, y) = (y, x) |
|---|
| 158 | | *) |
|---|
| 159 | | trait FnDecl extends FnAbsDeclOrDecl end |
|---|
| 160 | | object FnDef(mods:List[\Modifier\], |
|---|
| 161 | | name:Id, |
|---|
| 162 | | staticParams:List[\StaticParam\], |
|---|
| 163 | | params:List[\Param\], |
|---|
| 164 | | returnType:Maybe[\Type\], |
|---|
| 165 | | throwsClause:Maybe[\List[\TraitType\]\], |
|---|
| 166 | | whereClause:WhereClause, |
|---|
| 167 | | acontract:Contract, |
|---|
| 168 | | selfName:String, |
|---|
| 169 | | body:Expr) extends FnDecl end |
|---|
| 170 | | |
|---|
| 171 | | trait Param extends Node |
|---|
| 172 | | mods:List[\Modifier\] |
|---|
| 173 | | name:Id |
|---|
| 174 | | end |
|---|
| 175 | | object NormalParam(mods:List[\Modifier\], name:Id, atype:Maybe[\Type\], defaultExpr:Maybe[\Expr\]) extends Param end |
|---|
| 176 | | object VarargsParam(mods:List[\Modifier\], name:Id, varargsType:VarargsType) extends Param end |
|---|
| 177 | | |
|---|
| 178 | | (* TODO: Implement DimUnitDecl *) |
|---|
| 179 | | |
|---|
| 180 | | (* TODO: Implement TestDecl *) |
|---|
| 181 | | |
|---|
| 182 | | (* TODO: Implement PropertyDecl *) |
|---|
| 183 | | |
|---|
| 184 | | (* TODO: Implement GrammarDecl *) |
|---|
| 185 | | |
|---|
| 186 | | (* TODO: Implement ProductionDecl *) |
|---|
| 187 | | |
|---|
| 188 | | (* TODO: Implement SyntaxDecl *) |
|---|
| 189 | | |
|---|
| 190 | | (* TODO: Implement SymbolDecl *) |
|---|
| 191 | | |
|---|
| 192 | | trait Expr extends AbstractNode end |
|---|
| 193 | | |
|---|
| 194 | | object AsExpr(expr : Expr, atype : Type) extends Expr end |
|---|
| 195 | | object AsIfExpr(expr:Expr, atype:Type) extends Expr end |
|---|
| 196 | | |
|---|
| 197 | | trait TaggedUnitExpr extends Expr |
|---|
| 198 | | val : Expr |
|---|
| 199 | | unitExpr : UnitExpr |
|---|
| 200 | | end |
|---|
| 201 | | object ProductUnitExpr(val:Expr, unitExpr:UnitExpr) extends TaggedUnitExpr end |
|---|
| 202 | | object QuotientUnitExpr(val:Expr, unitExpr:UnitExpr) extends TaggedUnitExpr end |
|---|
| 203 | | |
|---|
| 204 | | object ChangeUnitExpr(val:Expr, unitExpr:UnitExpr) extends Expr end |
|---|
| 205 | | object Assignment(lhs:List[\Lhs\], aopr:Maybe[\Op\], rhs:Expr) extends Expr end |
|---|
| 206 | | |
|---|
| 207 | | trait DelimitedExpr extends Expr end |
|---|
| 208 | | object Block(exprs:List[\Expr\]) extends DelimitedExpr end |
|---|
| 209 | | object CaseExpr(param:CaseParam, compare:Maybe[\Op\], clauses:List[\CaseClause\], elseClause:Maybe[\Block\]) extends DelimitedExpr end |
|---|
| 210 | | object Do(fronts:List[\DoFront\]) extends DelimitedExpr end |
|---|
| 211 | | object For[\T\](gens:List[\Generator[\T\]\], body:DoFront) extends DelimitedExpr end |
|---|
| 212 | | object If(clauses:List[\IfClause\], elseClause:Maybe[\Block\]) extends DelimitedExpr end |
|---|
| 213 | | object Label(name:Id, body:Block) extends DelimitedExpr end |
|---|
| 214 | | object Try(body:Block, catchClause:Maybe[\Catch\], forbids:List[\TraitType\], finallyClause:Maybe[\Block\]) extends DelimitedExpr end |
|---|
| 215 | | |
|---|
| 216 | | trait AbstractTupleExpr extends DelimitedExpr end |
|---|
| 217 | | object TupleExpr(exprs:List[\Expr\], varargs:Maybe[\VarargsExpr\], keywords:List[\Binding\]) extends DelimitedExpr end |
|---|
| 218 | | |
|---|
| 219 | | object Typecase(bind:List[\Binding\], clauses:List[\TypecaseClause\], elseClause:Maybe[\Block\]) extends DelimitedExpr end |
|---|
| 220 | | object While(testExpr:Expr, body:Do) extends DelimitedExpr end |
|---|
| 221 | | |
|---|
| 222 | | trait FlowExpr extends Expr end |
|---|
| 223 | | trait BigOpApp extends FlowExpr end |
|---|
| 224 | | object Accumulator[\T\](aopr:Op, gens:List[\Generator[\T\]\], body:Expr) extends FlowExpr end |
|---|
| 225 | | |
|---|
| 226 | | object AtomicExpr(expr:Expr) extends FlowExpr end |
|---|
| 227 | | object Exit(target:Maybe[\Id\], returnExpr:Maybe[\Expr\]) extends FlowExpr end |
|---|
| 228 | | object Spawn(body:Expr) extends FlowExpr end |
|---|
| 229 | | object Throw(expr:Expr) extends FlowExpr end |
|---|
| 230 | | object TryAtomicExpr(expr:Expr) extends FlowExpr end |
|---|
| 231 | | |
|---|
| 232 | | object FnExpr(parenthesized:Boolean, name:Id, staticParams:List[\StaticParam\], params:List[\Param\], returnType:Maybe[\Type\], whereClause:List[\WhereClause\], throwsClause:Maybe[\List[\TraitType\]\], body:Expr) extends { Expr, Applicable } end |
|---|
| 233 | | |
|---|
| 234 | | trait LetExpr extends Expr |
|---|
| 235 | | body:List[\Expr\] |
|---|
| 236 | | end |
|---|
| 237 | | object LetFn(body:List[\Expr\], fns:List[\FnDef\]) extends LetExpr end |
|---|
| 238 | | object LocalVarDecl(lhs:List[\LValue\], rhs:Maybe[\IntLiteralExpr\]) extends LetExpr end |
|---|
| 239 | | |
|---|
| 240 | | object GeneratedExpr[\T\](expr:Expr, gens:List[\Generator[\T\]\]) extends FlowExpr end |
|---|
| 241 | | |
|---|
| 242 | | trait SimpleExpr extends FlowExpr end |
|---|
| 243 | | (* object SubscriptExpr(obj:Expr, subs:List[\Expr\], op:Maybe[\SubscriptOp\]) extends { Lhs, OpExpr } end *) |
|---|
| 244 | | trait Primary extends SimpleExpr end |
|---|
| 245 | | object CoercionInvocation(traitType:TraitType, staticArgs:List[\StaticArg\], arg:Expr) extends Primary end |
|---|
| 246 | | object MethodInvocation(obj:Expr, method:Id, staticArgs:List[\StaticArg\], arg:Expr) extends Primary end |
|---|
| 247 | | |
|---|
| 248 | | trait AbstractFieldRef extends { Primary, Lhs } |
|---|
| 249 | | obj:Expr |
|---|
| 250 | | end |
|---|
| 251 | | object FieldRef(field:Id) extends AbstractFieldRef end |
|---|
| 252 | | |
|---|
| 253 | | trait AppExpr extends Primary end |
|---|
| 254 | | trait Juxt extends Primary |
|---|
| 255 | | exprs:List[\Expr\] |
|---|
| 256 | | end |
|---|
| 257 | | trait LiteralExpr extends Primary |
|---|
| 258 | | val:String |
|---|
| 259 | | end |
|---|
| 260 | | |
|---|
| 261 | | trait NumberLiteralExpr extends LiteralExpr end |
|---|
| 262 | | object FloatLiteralExpr(val:String, intPart:ZZ64, numerator:ZZ64, denomBase:ZZ32, denomPower:ZZ32) extends NumberLiteralExpr end |
|---|
| 263 | | object IntLiteralExpr(val:ZZ32) extends NumberLiteralExpr end |
|---|
| 264 | | |
|---|
| 265 | | object CharLiteralExpr(val:ZZ32) extends LiteralExpr end |
|---|
| 266 | | object StringLiteralExpr(val:String) extends {Expr, LiteralExpr} end |
|---|
| 267 | | object VoidLiteralExpr(val:String) extends LiteralExpr end |
|---|
| 268 | | |
|---|
| 269 | | object LooseJuxt(exprs:List[\Expr\]) extends Juxt end |
|---|
| 270 | | object TightJuxt(exprs:List[\Expr\]) extends Juxt end |
|---|
| 271 | | object OpExpr(op:OpRef, args:List[\Expr\]) extends Expr end |
|---|
| 272 | | |
|---|
| 273 | | (* TODO: Pair |
|---|
| 274 | | object ChainExpr(first:Expr, links:List[\Pair[\Op, Expr\]\]) extends Primary end |
|---|
| 275 | | *) |
|---|
| 276 | | object FnRef(fns:List[\Id\], staticArgs:List[\StaticArg\]) extends Primary end |
|---|
| 277 | | |
|---|
| 278 | | (** |
|---|
| 279 | | * operator name with (inferred) static instantiations |
|---|
| 280 | | * list of operators allows cross-API overloading |
|---|
| 281 | | * Primary ::= Op[\StaticArgList\] |
|---|
| 282 | | * e.g.) +[\String\] |
|---|
| 283 | | *) |
|---|
| 284 | | object OpRef(ops:List[\OpName\], staticArgs:List[\StaticArg\]) end |
|---|
| 285 | | |
|---|
| 286 | | trait BaseExpr extends Primary end |
|---|
| 287 | | |
|---|
| 288 | | object VarRef(avar:Id) extends { BaseExpr, Lhs } end |
|---|
| 289 | | |
|---|
| 290 | | |
|---|
| 291 | | |
|---|
| 292 | | trait Aggregate extends BaseExpr end |
|---|
| 293 | | object MapExpr(elements:List[\Entry\]) extends Aggregate end |
|---|
| 294 | | |
|---|
| 295 | | trait ArrayExpr extends Aggregate end |
|---|
| 296 | | object ArrayElement(element:Expr) extends ArrayExpr end |
|---|
| 297 | | object ArrayElements(dimension:ZZ32, elements:List[\ArrayExpr\]) extends ArrayExpr end |
|---|
| 298 | | |
|---|
| 299 | | trait Comprehension extends Primary end |
|---|
| 300 | | (* TODO: |
|---|
| 301 | | Exception in thread "main" java.lang.IllegalArgumentException: Visitor com.sun.fortress.interpreter.evaluator.EvalType does not support visiting values of type com.sun.fortress.nodes.TaggedDimType |
|---|
| 302 | | object ArrayComprehension(List[\ArrayComprehensionClause\] clauses) extends Comprehension end |
|---|
| 303 | | *) |
|---|
| 304 | | trait GeneratedComprehension[\T\] extends Comprehension |
|---|
| 305 | | gens:List[\Generator[\T\]\] |
|---|
| 306 | | end |
|---|
| 307 | | object SetComprehension[\T\](gens:List[\Generator[\T\]\], element:Expr) extends GeneratedComprehension[\T\] end |
|---|
| 308 | | object MapComprehension[\T\](gens:List[\Generator[\T\]\], entry:Entry) extends GeneratedComprehension[\T\] end |
|---|
| 309 | | object ListComprehension[\T\](gens:List[\Generator[\T\]\], element:Expr) extends GeneratedComprehension[\T\] end |
|---|
| 310 | | |
|---|
| 311 | | trait Type extends AbstractNode end |
|---|
| 312 | | object ArrowType(domain:Type, range:Type, throwsClause:Maybe[\List[\TraitType\]\]) extends Type end |
|---|
| 313 | | |
|---|
| 314 | | trait NonArrowType extends Type end |
|---|
| 315 | | trait TraitType extends NonArrowType end |
|---|
| 316 | | object ArrayType(element:Type, indices:Indices) extends TraitType end |
|---|
| 317 | | object IdType(name:Id) extends TraitType end |
|---|
| 318 | | object MatrixType[\T\](element:Type, dimensions:List[\ExtentRange[\T\]\]) extends TraitType end |
|---|
| 319 | | object InstantiatedType(name:Id, args:List[\StaticArg\]) extends TraitType end |
|---|
| 320 | | |
|---|
| 321 | | object TupleType(elements:List[\Type\], varargs:Maybe[\VarargsType\], keywords:List[\KeywordType\]) extends NonArrowType end |
|---|
| 322 | | object VoidType() extends NonArrowType end |
|---|
| 323 | | |
|---|
| 324 | | trait DimType extends NonArrowType end |
|---|
| 325 | | (* object TaggedDimType(atype:Type, dims:DimExpr, Maybe[\UnitExpr\]) extends DimType end *) |
|---|
| 326 | | object TaggedUnitType(atype:Type, unitExpr:UnitExpr) extends NonArrowType end |
|---|
| 327 | | |
|---|
| 328 | | trait StaticArg extends Type end |
|---|
| 329 | | (* TODO: Implement static args *) |
|---|
| 330 | | |
|---|
| 331 | | trait StaticExpr extends AbstractNode end |
|---|
| 332 | | (* TODO: Implement static exprs. *) |
|---|
| 333 | | |
|---|
| 334 | | (** |
|---|
| 335 | | * integer expression |
|---|
| 336 | | *) |
|---|
| 337 | | trait IntExpr extends StaticExpr end |
|---|
| 338 | | |
|---|
| 339 | | (** |
|---|
| 340 | | * boolean expression |
|---|
| 341 | | * StaticExpr ::= BoolExpr |
|---|
| 342 | | *) |
|---|
| 343 | | trait BoolExpr extends StaticExpr end |
|---|
| 344 | | |
|---|
| 345 | | (* TODO: rest *) |
|---|
| 346 | | (** |
|---|
| 347 | | * boolean constraint |
|---|
| 348 | | * BoolExpr ::= BoolConstraint |
|---|
| 349 | | *) |
|---|
| 350 | | trait BoolConstraint extends BoolExpr end |
|---|
| 351 | | |
|---|
| 352 | | trait UnitExpr extends StaticExpr end |
|---|
| 353 | | |
|---|
| 354 | | (** |
|---|
| 355 | | * dimension expression |
|---|
| 356 | | *) |
|---|
| 357 | | trait DimExpr extends StaticExpr end |
|---|
| 358 | | |
|---|
| 359 | | object WhereClause(bindings:List[\WhereBinding\], constraints:List[\WhereConstraint\]) extends AbstractNode end |
|---|
| 360 | | trait WhereBinding extends AbstractNode end |
|---|
| 361 | | trait WhereConstraint extends AbstractNode end |
|---|
| 362 | | |
|---|
| 363 | | (* |
|---|
| 364 | | object WhereExtends(name:Id, supers:List[\TraitType\]) extends WhereClause end |
|---|
| 365 | | object TypeAlias(name:Id, staticParams:List[\StaticParam\], atype:Type) extends { WhereClause, Decl, AbsDecl } end |
|---|
| 366 | | object WhereNat(name:Id) extends WhereClause end |
|---|
| 367 | | object WhereInt(name:Id) extends WhereClause end |
|---|
| 368 | | object WhereBool(name:Id) extends WhereClause end |
|---|
| 369 | | object WhereUnit(name:Id) extends WhereClause end |
|---|
| 370 | | object WhereCoerces(left:Type, right:Type) extends WhereClause end |
|---|
| 371 | | object WhereWidens(left:Type, right:Type) extends WhereClause end |
|---|
| 372 | | object WhereWidensCoerces(left:Type, right:Type) extends WhereClause end |
|---|
| 373 | | object WhereEquals(left:Id, right:Id) extends WhereClause end |
|---|
| 374 | | object UnitConstraint(name:Id) extends WhereClause end |
|---|
| 375 | | |
|---|
| 376 | | trait IntConstraint extends WhereClause end |
|---|
| 377 | | object LEConstraint(left:IntExpr, right:IntExpr) extends IntConstraint end |
|---|
| 378 | | object LTConstraint(left:IntExpr, right:IntExpr) extends IntConstraint end |
|---|
| 379 | | object GEConstraint(left:IntExpr, right:IntExpr) extends IntConstraint end |
|---|
| 380 | | object GTConstraint(left:IntExpr, right:IntExpr) extends IntConstraint end |
|---|
| 381 | | object IEConstraint(left:IntExpr, right:IntExpr) extends IntConstraint end |
|---|
| 382 | | object BoolConstraintExpr(constraint:BoolConstraint) extends WhereClause end |
|---|
| 383 | | *) |
|---|
| 384 | | (** |
|---|
| 385 | | * contracts used in functional declarations and object declarations |
|---|
| 386 | | * Contract ::= Requires? Ensures? Invariant? |
|---|
| 387 | | * Requires ::= requires { ExprList? } |
|---|
| 388 | | * Ensures ::= ensures { EnsuresClauseList? } |
|---|
| 389 | | * Invariant ::= invariant { ExprList? } |
|---|
| 390 | | * CoercionContract ::= Ensures? Invariant? |
|---|
| 391 | | * e.g.) requires { n GE 0 } ensures { result GE 0 } |
|---|
| 392 | | *) |
|---|
| 393 | | object Contract(requiresLs:Maybe[\List[\Expr\]\], ensuresLs:Maybe[\List[\EnsuresClause\]\], invariantsLs:Maybe[\List[\Expr\]\]) extends AbstractNode end |
|---|
| 394 | | (** |
|---|
| 395 | | * ensures clause used in contracts |
|---|
| 396 | | * EnsuresClause ::= Expr (provided Expr)? |
|---|
| 397 | | * e.g.) sorted(result) provided sorted(input) |
|---|
| 398 | | *) |
|---|
| 399 | | object EnsuresClause(post:Expr, pre:Maybe[\Expr\]) extends AbstractNode end |
|---|
| 400 | | |
|---|
| 401 | | trait Modifier extends AbstractNode end |
|---|
| 402 | | (* TODO: Implement modifiers *) |
|---|
| 403 | | |
|---|
| 404 | | (** |
|---|
| 405 | | * static parameter |
|---|
| 406 | | *) |
|---|
| 407 | | trait StaticParam extends AbstractNode end |
|---|
| 408 | | |
|---|
| 409 | | (* TODO: Implement static params *) |
|---|
| 410 | | |
|---|
| 411 | | trait Name extends AbstractNode end |
|---|
| 412 | | object APIName(ids:List[\Id\]) extends Name end |
|---|
| 413 | | |
|---|
| 414 | | (** |
|---|
| 415 | | * name prefixed by an optional API name |
|---|
| 416 | | *) |
|---|
| 417 | | trait IdOrOpOrAnonymousName extends Name |
|---|
| 418 | | aapi:Maybe[\APIName\] |
|---|
| 419 | | end |
|---|
| 420 | | (** |
|---|
| 421 | | * identifier or operator name |
|---|
| 422 | | *) |
|---|
| 423 | | trait IdOrOpName extends IdOrOpOrAnonymousName end |
|---|
| 424 | | (** |
|---|
| 425 | | * identifier name |
|---|
| 426 | | * Id ::= Id(.Id)* |
|---|
| 427 | | * e.g.) com.sun.fortress.nodes_util.getName |
|---|
| 428 | | *) |
|---|
| 429 | | object Id(apiName:Maybe[\APIName\], name:String) extends IdOrOpName end |
|---|
| 430 | | (** |
|---|
| 431 | | * qualified operator name |
|---|
| 432 | | * internal uses only |
|---|
| 433 | | * e.g.) com.sun.fortress.nodes_util.+ |
|---|
| 434 | | *) |
|---|
| 435 | | trait OpName extends IdOrOpName end |
|---|
| 436 | | (** |
|---|
| 437 | | * non-enclosing operator |
|---|
| 438 | | * e.g.) COMPOSE |
|---|
| 439 | | * e.g.) === |
|---|
| 440 | | *) |
|---|
| 441 | | object Op(apiName:Maybe[\APIName\], text:String, fixity:Maybe[\Fixity\]) extends OpName end |
|---|
| 442 | | (** |
|---|
| 443 | | * pair of enclosing operators |
|---|
| 444 | | * EncloserPair ::= LeftEncloser RightEncloser |
|---|
| 445 | | * e.g.) </ /> |
|---|
| 446 | | *) |
|---|
| 447 | | object Enclosing(apiName:Maybe[\APIName\], open:Op, close:Op) extends OpName end |
|---|
| 448 | | |
|---|
| 449 | | (* TODO: Implement AnonymousFnName *) |
|---|
| 450 | | |
|---|
| 451 | | (* TODO: Implement ConstructorFNName *) |
|---|
| 452 | | |
|---|
| 453 | | (* TODO: Implement ArrayComprehensionClause *) |
|---|
| 454 | | |
|---|
| 455 | | (** |
|---|
| 456 | | * binding used in tuple expressions and typecase expressions |
|---|
| 457 | | * Binding ::= Id = Expr |
|---|
| 458 | | * e.g.) x = myLoser.myField |
|---|
| 459 | | *) |
|---|
| 460 | | object Binding(name:Id, init:Expr) extends AbstractNode end |
|---|
| 461 | | (** |
|---|
| 462 | | * case clause used in case expressions and extremum expressions |
|---|
| 463 | | * CaseClause ::= Expr => BlockElems |
|---|
| 464 | | * e.g.) { Jupiter, Saturn, Uranus, Neptune } => "outer" |
|---|
| 465 | | *) |
|---|
| 466 | | object CaseClause(match:Expr, body:Block) extends AbstractNode end |
|---|
| 467 | | (** |
|---|
| 468 | | * condition expression used in case expressions and extremum expressions |
|---|
| 469 | | *) |
|---|
| 470 | | trait CaseParam extends AbstractNode end |
|---|
| 471 | | (** |
|---|
| 472 | | * condition expression used in case expressions |
|---|
| 473 | | *) |
|---|
| 474 | | object CaseParamExpr(expr:Expr) extends CaseParam end |
|---|
| 475 | | (** |
|---|
| 476 | | * "largest" used in extremum expressions |
|---|
| 477 | | *) |
|---|
| 478 | | object CaseParamLargest() extends CaseParam end |
|---|
| 479 | | (** |
|---|
| 480 | | * "smallest" used in extremum expressions |
|---|
| 481 | | *) |
|---|
| 482 | | object CaseParamSmallest() extends CaseParam end |
|---|
| 483 | | |
|---|
| 484 | | (* TODO: Implement contract *) |
|---|
| 485 | | |
|---|
| 486 | | (** |
|---|
| 487 | | * catch clause used in try expressions |
|---|
| 488 | | * Catch ::= catch Id CatchClauses |
|---|
| 489 | | * e.g.) catch e IOException => throw ForbiddenException(e) |
|---|
| 490 | | *) |
|---|
| 491 | | object Catch(name:Id, clauses:List[\CatchClause\]) extends AbstractNode end |
|---|
| 492 | | (** |
|---|
| 493 | | * each clause in a catch clause used in try expressions |
|---|
| 494 | | * CatchClause ::= TraitType => BlockElems |
|---|
| 495 | | * e.g.) IOException => throw ForbiddenException(e) |
|---|
| 496 | | *) |
|---|
| 497 | | object CatchClause(match:TraitType, body:Block) extends AbstractNode end |
|---|
| 498 | | (** |
|---|
| 499 | | * block expression used in do expressions |
|---|
| 500 | | * DoFront ::= (at Expr)? atomic? do BlockElems? |
|---|
| 501 | | * e.g.) at a.region(j) do w := a_j |
|---|
| 502 | | *) |
|---|
| 503 | | object DoFront(loc:Maybe[\Expr\], isatomic:Boolean, body:Block) extends AbstractNode end |
|---|
| 504 | | (** |
|---|
| 505 | | * if clause used in if expressions |
|---|
| 506 | | * DelimitedExpr ::= if Expr then BlockElems Elifs? Else? end |
|---|
| 507 | | * Elif ::= elif Expr then BlockElems |
|---|
| 508 | | * e.g.) if x IN { 0, 1, 2 } then 0 |
|---|
| 509 | | *) |
|---|
| 510 | | object IfClause(condition:Expr, body:Block) extends AbstractNode end |
|---|
| 511 | | (** |
|---|
| 512 | | * typecase clause used in typecase expressions |
|---|
| 513 | | * TypecaseClause ::= TypecaseTypes => BlockElems |
|---|
| 514 | | * TypecaseTypes ::= ( TypeList ) |
|---|
| 515 | | * | Type |
|---|
| 516 | | * e.g.) String => x.append("foo") |
|---|
| 517 | | *) |
|---|
| 518 | | object TypecaseClause(match:List[\Type\], body:Block) extends AbstractNode end |
|---|
| 519 | | (** |
|---|
| 520 | | * key/value pair used in map expressions and map comprehensions |
|---|
| 521 | | * Entry ::= Expr |-> Expr |
|---|
| 522 | | * e.g.) 'a' |-> 0 |
|---|
| 523 | | *) |
|---|
| 524 | | object Entry(key:Expr, valueExpr:Expr) extends AbstractNode end |
|---|
| 525 | | |
|---|
| 526 | | (* TODO: Implement extent range *) |
|---|
| 527 | | |
|---|
| 528 | | (* TODO: Implement generator *) |
|---|
| 529 | | |
|---|
| 530 | | (** |
|---|
| 531 | | * varargs expression used in tuple expressions |
|---|
| 532 | | * Expr... |
|---|
| 533 | | * e.g.) [3 4 5]... |
|---|
| 534 | | *) |
|---|
| 535 | | object VarargsExpr(varargs:Expr) extends AbstractNode end |
|---|
| 536 | | (** |
|---|
| 537 | | * varargs type used in tuple types and varargs parameters |
|---|
| 538 | | * Type ... |
|---|
| 539 | | * e.g.) ZZ32... |
|---|
| 540 | | *) |
|---|
| 541 | | object VarargsType(baseType:Type) extends AbstractNode end |
|---|
| 542 | | (** |
|---|
| 543 | | * keyword type used in tuple types |
|---|
| 544 | | * KeywordType ::= Id = Type |
|---|
| 545 | | * e.g.) x = String |
|---|
| 546 | | *) |
|---|
| 547 | | object KeywordType(name:Id, atype:Type) extends AbstractNode end |
|---|
| 548 | | (** |
|---|
| 549 | | * trait type with a where clause used in extends clauses |
|---|
| 550 | | * TraitTypeWhere ::= TraitType Where? |
|---|
| 551 | | *) |
|---|
| 552 | | object TraitTypeWhere(traitType:TraitType, whereLs:List[\WhereClause\]) extends AbstractNode end |
|---|
| 553 | | (** |
|---|
| 554 | | * array indices |
|---|
| 555 | | *) |
|---|
| 556 | | trait Indices extends AbstractNode end |
|---|
| 557 | | (** |
|---|
| 558 | | * array dimensionality |
|---|
| 559 | | * ArraySize ::= ExtentRange(, ExtentRange)* |
|---|
| 560 | | * e.g.) 3, 2#1, 3:5 |
|---|
| 561 | | *) |
|---|
| 562 | | object FixedDim[\T\](extents:List[\ExtentRange[\T\]\]) extends Indices end |
|---|
| 563 | | |
|---|
| 564 | | (* TODO: Implement DimUnitOps *) |
|---|
| 565 | | |
|---|
| 566 | | (** |
|---|
| 567 | | * operator fixity |
|---|
| 568 | | *) |
|---|
| 569 | | trait Fixity extends AbstractNode end |
|---|
| 570 | | (** |
|---|
| 571 | | * e.g.) 3 + 5 |
|---|
| 572 | | *) |
|---|
| 573 | | object InFixity() extends Fixity end |
|---|
| 574 | | (** |
|---|
| 575 | | * e.g.) -5 |
|---|
| 576 | | *) |
|---|
| 577 | | object PreFixity() extends Fixity end |
|---|
| 578 | | (** |
|---|
| 579 | | * e.g.) 3! |
|---|
| 580 | | *) |
|---|
| 581 | | object PostFixity() extends Fixity end |
|---|
| 582 | | (** |
|---|
| 583 | | * e.g.) : |
|---|
| 584 | | *) |
|---|
| 585 | | object NoFixity() extends Fixity end |
|---|
| 586 | | (** |
|---|
| 587 | | * e.g.) S1 BY S2 BY S3 |
|---|
| 588 | | *) |
|---|
| 589 | | object MultiFixity() extends Fixity end |
|---|
| 590 | | (** |
|---|
| 591 | | * left encloser or right encloser |
|---|
| 592 | | * e.g.) <| |
|---|
| 593 | | *) |
|---|
| 594 | | object EnclosingFixity() extends Fixity end |
|---|
| 595 | | (** |
|---|
| 596 | | * BIG operator |
|---|
| 597 | | *) |
|---|
| 598 | | object BigFixity() extends Fixity end |
|---|
| | 7 | trait AbsDecl extends AbsDeclOrDecl end |
|---|
| | 8 | trait AbsDeclOrDecl extends Node end |
|---|
| | 9 | trait Decl extends AbsDeclOrDecl end |
|---|
| | 10 | trait Generic extends Node |
|---|
| | 11 | in_staticParams:List[\StaticParam\] |
|---|
| | 12 | end |
|---|
| | 13 | trait GenericAbsDeclOrDecl extends { Node, Generic, AbsDeclOrDecl } end |
|---|
| | 14 | trait GenericAbsDeclOrDeclWithParams extends { Node, GenericWithParams, GenericAbsDeclOrDecl } end |
|---|
| | 15 | trait GenericDecl extends { GenericAbsDeclOrDecl, Decl } end |
|---|
| | 16 | trait GenericDeclWithParams extends { GenericAbsDeclOrDeclWithParams, GenericDecl } end |
|---|
| | 17 | trait GenericWithParams extends { Node, Generic, HasParams } end |
|---|
| | 18 | trait HasParams extends Node |
|---|
| | 19 | in_params:Maybe[\List[\Param\]\] |
|---|
| | 20 | in_decls:List[\AbsDeclOrDecl\] |
|---|
| | 21 | end |
|---|
| | 22 | trait HasWhere extends Node |
|---|
| | 23 | in_where:WhereClause |
|---|
| | 24 | end |
|---|
| | 25 | trait Lhs extends Node end |
|---|
| | 26 | trait Node end |
|---|
| | 27 | trait TemplateGap extends Node |
|---|
| | 28 | in_id:Id |
|---|
| | 29 | in_templateParams:List[\Id\] |
|---|
| | 30 | end |
|---|
| | 31 | trait TypeOrDomain extends Node end |
|---|
| | 32 | object APIName (in_ids:List[\Id\]) extends Name |
|---|
| | 33 | toString():String |
|---|
| | 34 | end |
|---|
| | 35 | trait AbbreviatedType extends BaseType |
|---|
| | 36 | in_type:Type |
|---|
| | 37 | end |
|---|
| | 38 | object AbsExternalSyntax (in_openExpander:IdOrOpOrAnonymousName, in_name:Id, in_closeExpander:IdOrOpOrAnonymousName) extends { ExternalSyntaxAbsDeclOrDecl, AbsDecl } |
|---|
| | 39 | toString():String |
|---|
| | 40 | end |
|---|
| | 41 | object AbsFnDecl (in_mods:List[\Modifier\], in_name:IdOrOpOrAnonymousName, in_staticParams:List[\StaticParam\], in_params:List[\Param\], in_returnType:Maybe[\Type\], in_throwsClause:Maybe[\List[\BaseType\]\], in_where:WhereClause, in_contract:Contract, in_selfName:String) extends { FnAbsDeclOrDecl, AbsDecl } |
|---|
| | 42 | toString():String |
|---|
| | 43 | end |
|---|
| | 44 | object AbsObjectDecl (in_mods:List[\Modifier\], in_name:Id, in_staticParams:List[\StaticParam\], in_extendsClause:List[\TraitTypeWhere\], in_where:WhereClause, in_params:Maybe[\List[\Param\]\], in_throwsClause:Maybe[\List[\BaseType\]\], in_contract:Contract, in_decls:List[\AbsDecl\]) extends { ObjectAbsDeclOrDecl, AbsDecl } |
|---|
| | 45 | toString():String |
|---|
| | 46 | end |
|---|
| | 47 | object AbsTraitDecl (in_mods:List[\Modifier\], in_name:Id, in_staticParams:List[\StaticParam\], in_extendsClause:List[\TraitTypeWhere\], in_where:WhereClause, in_excludes:List[\BaseType\], in_comprises:Maybe[\List[\BaseType\]\], in_decls:List[\AbsDecl\]) extends { TraitAbsDeclOrDecl, AbsDecl } |
|---|
| | 48 | toString():String |
|---|
| | 49 | end |
|---|
| | 50 | object AbsVarDecl (in_lhs:List[\LValueBind\]) extends { VarAbsDeclOrDecl, AbsDecl, Decl } |
|---|
| | 51 | toString():String |
|---|
| | 52 | end |
|---|
| | 53 | trait AbstractArrowType extends Type |
|---|
| | 54 | in_domain:Domain |
|---|
| | 55 | in_range:Type |
|---|
| | 56 | in_effect:Effect |
|---|
| | 57 | end |
|---|
| | 58 | trait AbstractFieldRef extends { Primary, Lhs } |
|---|
| | 59 | in_obj:Expr |
|---|
| | 60 | end |
|---|
| | 61 | trait AbstractNode extends Node end |
|---|
| | 62 | trait AbstractObjectExpr extends DelimitedExpr |
|---|
| | 63 | in_extendsClause:List[\TraitTypeWhere\] |
|---|
| | 64 | in_decls:List[\Decl\] |
|---|
| | 65 | end |
|---|
| | 66 | trait AbstractTupleExpr extends DelimitedExpr |
|---|
| | 67 | in_exprs:List[\Expr\] |
|---|
| | 68 | end |
|---|
| | 69 | trait AbstractTupleType extends Type |
|---|
| | 70 | in_elements:List[\Type\] |
|---|
| | 71 | end |
|---|
| | 72 | object Accumulator (in_staticArgs:List[\StaticArg\], in_opr:OpName, in_gens:List[\GeneratorClause\], in_body:Expr) extends BigOpApp |
|---|
| | 73 | toString():String |
|---|
| | 74 | end |
|---|
| | 75 | object AliasedAPIName (in_api:APIName, in_alias:Maybe[\Id\]) extends AbstractNode |
|---|
| | 76 | toString():String |
|---|
| | 77 | end |
|---|
| | 78 | object AliasedSimpleName (in_name:IdOrOpOrAnonymousName, in_alias:Maybe[\IdOrOpOrAnonymousName\]) extends AbstractNode |
|---|
| | 79 | toString():String |
|---|
| | 80 | end |
|---|
| | 81 | object AndConstraint (in_left:BoolExpr, in_right:BoolExpr) extends BinaryBoolConstraint |
|---|
| | 82 | toString():String |
|---|
| | 83 | end |
|---|
| | 84 | object AndPredicateSymbol (in_symbol:SyntaxSymbol) extends SyntaxSymbol |
|---|
| | 85 | toString():String |
|---|
| | 86 | end |
|---|
| | 87 | object AnonymousFnName (in_api:Maybe[\APIName\]) extends AnonymousName |
|---|
| | 88 | toString():String |
|---|
| | 89 | end |
|---|
| | 90 | trait AnonymousName extends IdOrOpOrAnonymousName end |
|---|
| | 91 | object AnyCharacterSymbol extends SpecialSymbol |
|---|
| | 92 | toString():String |
|---|
| | 93 | end |
|---|
| | 94 | object AnyType extends BaseType |
|---|
| | 95 | toString():String |
|---|
| | 96 | end |
|---|
| | 97 | object Api (in_name:APIName, in_imports:List[\Import\], in_decls:List[\AbsDecl\]) extends CompilationUnit |
|---|
| | 98 | toString():String |
|---|
| | 99 | end |
|---|
| | 100 | trait AppExpr extends Primary end |
|---|
| | 101 | object ArgExpr (in_exprs:List[\Expr\], in_varargs:Maybe[\VarargsExpr\], in_keywords:List[\KeywordExpr\], in_inApp:Boolean) extends AbstractTupleExpr |
|---|
| | 102 | toString():String |
|---|
| | 103 | end |
|---|
| | 104 | object ArrayComprehension (in_staticArgs:List[\StaticArg\], in_clauses:List[\ArrayComprehensionClause\]) extends BigOpApp |
|---|
| | 105 | toString():String |
|---|
| | 106 | end |
|---|
| | 107 | object ArrayComprehensionClause (in_bind:List[\Expr\], in_init:Expr, in_gens:List[\GeneratorClause\]) extends AbstractNode |
|---|
| | 108 | toString():String |
|---|
| | 109 | end |
|---|
| | 110 | object ArrayElement (in_staticArgs:List[\StaticArg\], in_element:Expr) extends ArrayExpr |
|---|
| | 111 | toString():String |
|---|
| | 112 | end |
|---|
| | 113 | object ArrayElements (in_staticArgs:List[\StaticArg\], in_dimension:ZZ32, in_elements:List[\ArrayExpr\]) extends ArrayExpr |
|---|
| | 114 | toString():String |
|---|
| | 115 | end |
|---|
| | 116 | trait ArrayExpr extends Primary |
|---|
| | 117 | in_staticArgs:List[\StaticArg\] |
|---|
| | 118 | end |
|---|
| | 119 | object ArrayType (in_type:Type, in_indices:Indices) extends AbbreviatedType |
|---|
| | 120 | toString():String |
|---|
| | 121 | end |
|---|
| | 122 | object ArrowType (in_domain:Domain, in_range:Type, in_effect:Effect) extends AbstractArrowType |
|---|
| | 123 | toString():String |
|---|
| | 124 | end |
|---|
| | 125 | object AsExpr (in_expr:Expr, in_type:Type) extends TypeAnnotatedExpr |
|---|
| | 126 | toString():String |
|---|
| | 127 | end |
|---|
| | 128 | object AsIfExpr (in_expr:Expr, in_type:Type) extends TypeAnnotatedExpr |
|---|
| | 129 | toString():String |
|---|
| | 130 | end |
|---|
| | 131 | object Assignment (in_lhs:List[\Lhs\], in_opr:Maybe[\OpRef\], in_rhs:Expr) extends Expr |
|---|
| | 132 | toString():String |
|---|
| | 133 | end |
|---|
| | 134 | object AtomicExpr (in_expr:Expr) extends FlowExpr |
|---|
| | 135 | toString():String |
|---|
| | 136 | end |
|---|
| | 137 | object BEConstraint (in_left:BoolExpr, in_right:BoolExpr) extends BinaryBoolConstraint |
|---|
| | 138 | toString():String |
|---|
| | 139 | end |
|---|
| | 140 | object BackspaceSymbol extends SpecialSymbol |
|---|
| | 141 | toString():String |
|---|
| | 142 | end |
|---|
| | 143 | object BaseDim extends DimExpr |
|---|
| | 144 | toString():String |
|---|
| | 145 | end |
|---|
| | 146 | trait BaseType extends Type end |
|---|
| | 147 | object BigFixity extends Fixity |
|---|
| | 148 | toString():String |
|---|
| | 149 | end |
|---|
| | 150 | trait BigOpApp extends FlowExpr |
|---|
| | 151 | in_staticArgs:List[\StaticArg\] |
|---|
| | 152 | end |
|---|
| | 153 | trait BinaryBoolConstraint extends BoolConstraint |
|---|
| | 154 | in_left:BoolExpr |
|---|
| | 155 | in_right:BoolExpr |
|---|
| | 156 | end |
|---|
| | 157 | object Block (in_exprs:List[\Expr\]) extends DelimitedExpr |
|---|
| | 158 | toString():String |
|---|
| | 159 | end |
|---|
| | 160 | object BoolArg (in_bool:BoolExpr) extends StaticArg |
|---|
| | 161 | toString():String |
|---|
| | 162 | end |
|---|
| | 163 | object BoolConstant (in_bool:Boolean) extends BoolVal |
|---|
| | 164 | toString():String |
|---|
| | 165 | end |
|---|
| | 166 | trait BoolConstraint extends BoolExpr end |
|---|
| | 167 | object BoolConstraintExpr (in_constraint:BoolConstraint) extends WhereConstraint |
|---|
| | 168 | toString():String |
|---|
| | 169 | end |
|---|
| | 170 | trait BoolExpr extends StaticExpr end |
|---|
| | 171 | object BoolParam (in_name:Id) extends IdStaticParam |
|---|
| | 172 | toString():String |
|---|
| | 173 | end |
|---|
| | 174 | object BoolRef (in_name:Id) extends BoolVal |
|---|
| | 175 | toString():String |
|---|
| | 176 | end |
|---|
| | 177 | trait BoolVal extends BoolExpr end |
|---|
| | 178 | object BottomType extends BaseType |
|---|
| | 179 | toString():String |
|---|
| | 180 | end |
|---|
| | 181 | trait BoundType extends Type |
|---|
| | 182 | in_elements:List[\Type\] |
|---|
| | 183 | end |
|---|
| | 184 | object BreaklineSymbol (in_s:String) extends SpecialSymbol |
|---|
| | 185 | toString():String |
|---|
| | 186 | end |
|---|
| | 187 | object CarriageReturnSymbol extends SpecialSymbol |
|---|
| | 188 | toString():String |
|---|
| | 189 | end |
|---|
| | 190 | object CaseClause (in_match:Expr, in_body:Block) extends AbstractNode |
|---|
| | 191 | toString():String |
|---|
| | 192 | end |
|---|
| | 193 | object CaseExpr (in_param:Maybe[\Expr\], in_compare:Maybe[\OpRef\], in_equalsOp:OpRef, in_inOp:OpRef, in_clauses:List[\CaseClause\], in_elseClause:Maybe[\Block\]) extends DelimitedExpr |
|---|
| | 194 | toString():String |
|---|
| | 195 | end |
|---|
| | 196 | object Catch (in_name:Id, in_clauses:List[\CatchClause\]) extends AbstractNode |
|---|
| | 197 | toString():String |
|---|
| | 198 | end |
|---|
| | 199 | object CatchClause (in_match:BaseType, in_body:Block) extends AbstractNode |
|---|
| | 200 | toString():String |
|---|
| | 201 | end |
|---|
| | 202 | object ChainExpr (in_first:Expr, in_links:List[\Link\]) extends AppExpr |
|---|
| | 203 | toString():String |
|---|
| | 204 | end |
|---|
| | 205 | object CharLiteralExpr (in_text:String, in_val:ZZ32) extends LiteralExpr |
|---|
| | 206 | toString():String |
|---|
| | 207 | end |
|---|
| | 208 | object CharSymbol (in_string:String) extends CharacterSymbol |
|---|
| | 209 | toString():String |
|---|
| | 210 | end |
|---|
| | 211 | object CharacterClassSymbol (in_characters:List[\CharacterSymbol\]) extends SyntaxSymbol |
|---|
| | 212 | toString():String |
|---|
| | 213 | end |
|---|
| | 214 | object CharacterInterval (in_begin:String, in_end:String) extends CharacterSymbol |
|---|
| | 215 | toString():String |
|---|
| | 216 | end |
|---|
| | 217 | trait CharacterSymbol extends SyntaxSymbol end |
|---|
| | 218 | object CoercionInvocation (in_type:BaseType, in_staticArgs:List[\StaticArg\], in_arg:Expr) extends AppExpr |
|---|
| | 219 | toString():String |
|---|
| | 220 | end |
|---|
| | 221 | trait CompilationUnit extends AbstractNode |
|---|
| | 222 | in_name:APIName |
|---|
| | 223 | in_imports:List[\Import\] |
|---|
| | 224 | end |
|---|
| | 225 | object Component (in__native:Boolean, in_name:APIName, in_imports:List[\Import\], in_exports:List[\Export\], in_decls:List[\Decl\]) extends CompilationUnit |
|---|
| | 226 | toString():String |
|---|
| | 227 | end |
|---|
| | 228 | object ConstructorFnName (in_api:Maybe[\APIName\], in_def:GenericWithParams) extends AnonymousName |
|---|
| | 229 | toString():String |
|---|
| | 230 | end |
|---|
| | 231 | object Contract (in_requires:Maybe[\List[\Expr\]\], in_ensures:Maybe[\List[\EnsuresClause\]\], in_invariants:Maybe[\List[\Expr\]\]) extends AbstractNode |
|---|
| | 232 | toString():String |
|---|
| | 233 | end |
|---|
| | 234 | trait DelimitedExpr extends Expr end |
|---|
| | 235 | object DimArg (in_dim:DimExpr) extends StaticArg |
|---|
| | 236 | toString():String |
|---|
| | 237 | end |
|---|
| | 238 | object DimDecl (in_dim:Id, in_derived:Maybe[\Type\], in_default:Maybe[\Id\]) extends DimUnitDecl |
|---|
| | 239 | toString():String |
|---|
| | 240 | end |
|---|
| | 241 | trait DimExpr extends Type end |
|---|
| | 242 | object DimParam (in_name:Id) extends IdStaticParam |
|---|
| | 243 | toString():String |
|---|
| | 244 | end |
|---|
| | 245 | object DimRef (in_name:Id) extends DimExpr |
|---|
| | 246 | toString():String |
|---|
| | 247 | end |
|---|
| | 248 | trait DimUnitDecl extends { AbstractNode, Decl, AbsDecl } end |
|---|
| | 249 | object Do (in_fronts:List[\DoFront\]) extends DelimitedExpr |
|---|
| | 250 | toString():String |
|---|
| | 251 | end |
|---|
| | 252 | object DoFront (in_loc:Maybe[\Expr\], in_atomic:Boolean, in_expr:Block) extends AbstractNode |
|---|
| | 253 | toString():String |
|---|
| | 254 | end |
|---|
| | 255 | object Domain (in_args:List[\Type\], in_varargs:Maybe[\Type\], in_keywords:List[\KeywordType\]) extends { AbstractNode, TypeOrDomain } |
|---|
| | 256 | toString():String |
|---|
| | 257 | end |
|---|
| | 258 | object Effect (in_throwsClause:Maybe[\List[\BaseType\]\], in_io:Boolean) extends AbstractNode |
|---|
| | 259 | toString():String |
|---|
| | 260 | end |
|---|
| | 261 | object Enclosing (in_api:Maybe[\APIName\], in_open:Op, in_close:Op) extends OpName |
|---|
| | 262 | toString():String |
|---|
| | 263 | end |
|---|
| | 264 | object EnclosingFixity extends Fixity |
|---|
| | 265 | toString():String |
|---|
| | 266 | end |
|---|
| | 267 | object EnsuresClause (in_post:Expr, in_pre:Maybe[\Expr\]) extends AbstractNode |
|---|
| | 268 | toString():String |
|---|
| | 269 | end |
|---|
| | 270 | object Exit (in_target:Maybe[\Id\], in_returnExpr:Maybe[\Expr\]) extends FlowExpr |
|---|
| | 271 | toString():String |
|---|
| | 272 | end |
|---|
| | 273 | object ExponentConstraint (in_left:IntExpr, in_right:IntExpr) extends IntOpExpr |
|---|
| | 274 | toString():String |
|---|
| | 275 | end |
|---|
| | 276 | object ExponentDim (in_base:DimExpr, in_power:IntExpr) extends DimExpr |
|---|
| | 277 | toString():String |
|---|
| | 278 | end |
|---|
| | 279 | object ExponentType (in_base:Type, in_power:IntExpr) extends DimExpr |
|---|
| | 280 | toString():String |
|---|
| | 281 | end |
|---|
| | 282 | object ExponentUnit (in_left:UnitExpr, in_right:UnitExpr) extends UnitOpExpr |
|---|
| | 283 | toString():String |
|---|
| | 284 | end |
|---|
| | 285 | object ExponentiationMI (in_op:OpRef, in_expr:Maybe[\Expr\]) extends NonExprMI |
|---|
| | 286 | toString():String |
|---|
| | 287 | end |
|---|
| | 288 | object Export (in_apis:List[\APIName\]) extends AbstractNode |
|---|
| | 289 | toString():String |
|---|
| | 290 | end |
|---|
| | 291 | trait Expr extends AbstractNode end |
|---|
| | 292 | trait ExprMI extends MathItem |
|---|
| | 293 | in_expr:Expr |
|---|
| | 294 | end |
|---|
| | 295 | object ExtentRange (in_base:Maybe[\StaticArg\], in_size:Maybe[\StaticArg\]) extends AbstractNode |
|---|
| | 296 | toString():String |
|---|
| | 297 | end |
|---|
| | 298 | object ExternalSyntax (in_openExpander:IdOrOpOrAnonymousName, in_name:Id, in_closeExpander:IdOrOpOrAnonymousName, in_expr:Expr) extends { ExternalSyntaxAbsDeclOrDecl, Decl } |
|---|
| | 299 | toString():String |
|---|
| | 300 | end |
|---|
| | 301 | trait ExternalSyntaxAbsDeclOrDecl extends { AbstractNode, AbsDeclOrDecl } |
|---|
| | 302 | in_openExpander:IdOrOpOrAnonymousName |
|---|
| | 303 | in_name:Id |
|---|
| | 304 | in_closeExpander:IdOrOpOrAnonymousName |
|---|
| | 305 | end |
|---|
| | 306 | object FieldRef (in_obj:Expr, in_field:Id) extends AbstractFieldRef |
|---|
| | 307 | toString():String |
|---|
| | 308 | end |
|---|
| | 309 | object FixedPointType (in_name:Id, in_body:Type) extends Type |
|---|
| | 310 | toString():String |
|---|
| | 311 | end |
|---|
| | 312 | trait Fixity extends AbstractNode end |
|---|
| | 313 | object FloatLiteralExpr (in_text:String, in_intPart:ZZ64, in_numerator:ZZ64, in_denomBase:ZZ32, in_denomPower:ZZ32) extends NumberLiteralExpr |
|---|
| | 314 | toString():String |
|---|
| | 315 | end |
|---|
| | 316 | trait FlowExpr extends Expr end |
|---|
| | 317 | trait FnAbsDeclOrDecl extends { AbstractNode, GenericDecl } |
|---|
| | 318 | in_mods:List[\Modifier\] |
|---|
| | 319 | in_name:IdOrOpOrAnonymousName |
|---|
| | 320 | in_staticParams:List[\StaticParam\] |
|---|
| | 321 | in_params:List[\Param\] |
|---|
| | 322 | in_returnType:Maybe[\Type\] |
|---|
| | 323 | in_throwsClause:Maybe[\List[\BaseType\]\] |
|---|
| | 324 | in_where:WhereClause |
|---|
| | 325 | in_contract:Contract |
|---|
| | 326 | in_selfName:String |
|---|
| | 327 | end |
|---|
| | 328 | trait FnDecl extends FnAbsDeclOrDecl end |
|---|
| | 329 | object FnDef (in_mods:List[\Modifier\], in_name:IdOrOpOrAnonymousName, in_staticParams:List[\StaticParam\], in_params:List[\Param\], in_returnType:Maybe[\Type\], in_throwsClause:Maybe[\List[\BaseType\]\], in_where:WhereClause, in_contract:Contract, in_selfName:String, in_body:Expr) extends FnDecl |
|---|
| | 330 | toString():String |
|---|
| | 331 | end |
|---|
| | 332 | object FnExpr (in_name:IdOrOpOrAnonymousName, in_staticParams:List[\StaticParam\], in_params:List[\Param\], in_returnType:Maybe[\Type\], in_where:WhereClause, in_throwsClause:Maybe[\List[\BaseType\]\], in_body:Expr) extends Expr |
|---|
| | 333 | toString():String |
|---|
| | 334 | end |
|---|
| | 335 | object FnRef (in_lexicalDepth:ZZ32, in_originalName:Id, in_fns:List[\Id\], in_staticArgs:List[\StaticArg\]) extends FunctionalRef |
|---|
| | 336 | toString():String |
|---|
| | 337 | end |
|---|
| | 338 | object For (in_gens:List[\GeneratorClause\], in_body:DoFront) extends DelimitedExpr |
|---|
| | 339 | toString():String |
|---|
| | 340 | end |
|---|
| | 341 | object FormfeedSymbol extends SpecialSymbol |
|---|
| | 342 | toString():String |
|---|
| | 343 | end |
|---|
| | 344 | trait FunctionalRef extends Primary |
|---|
| | 345 | in_staticArgs:List[\StaticArg\] |
|---|
| | 346 | in_lexicalDepth:ZZ32 |
|---|
| | 347 | end |
|---|
| | 348 | object GEConstraint (in_left:IntExpr, in_right:IntExpr) extends IntConstraint |
|---|
| | 349 | toString():String |
|---|
| | 350 | end |
|---|
| | 351 | object GTConstraint (in_left:IntExpr, in_right:IntExpr) extends IntConstraint |
|---|
| | 352 | toString():String |
|---|
| | 353 | end |
|---|
| | 354 | object GeneratedExpr (in_expr:Expr, in_gens:List[\GeneratorClause\]) extends Expr |
|---|
| | 355 | toString():String |
|---|
| | 356 | end |
|---|
| | 357 | object GeneratorClause (in_bind:List[\Id\], in_init:Expr) extends AbstractNode |
|---|
| | 358 | toString():String |
|---|
| | 359 | end |
|---|
| | 360 | trait GrammarDecl extends { AbstractNode, AbsDecl } |
|---|
| | 361 | in_name:Id |
|---|
| | 362 | in_extends:List[\Id\] |
|---|
| | 363 | end |
|---|
| | 364 | object GrammarDef (in_name:Id, in_extends:List[\Id\], in_members:List[\GrammarMemberDecl\]) extends GrammarDecl |
|---|
| | 365 | toString():String |
|---|
| | 366 | end |
|---|
| | 367 | trait GrammarMemberDecl extends { AbstractNode, AbsDecl } |
|---|
| | 368 | in_header:NonterminalHeader |
|---|
| | 369 | in_astType:Maybe[\BaseType\] |
|---|
| | 370 | end |
|---|
| | 371 | object GroupSymbol (in_symbols:List[\SyntaxSymbol\]) extends SyntaxSymbol |
|---|
| | 372 | toString():String |
|---|
| | 373 | end |
|---|
| | 374 | object IEConstraint (in_left:IntExpr, in_right:IntExpr) extends IntConstraint |
|---|
| | 375 | toString():String |
|---|
| | 376 | end |
|---|
| | 377 | object Id (in_api:Maybe[\APIName\], in_text:String) extends IdOrOpName |
|---|
| | 378 | toString():String |
|---|
| | 379 | end |
|---|
| | 380 | trait IdOrOpName extends IdOrOpOrAnonymousName end |
|---|
| | 381 | trait IdOrOpOrAnonymousName extends Name |
|---|
| | 382 | in_api:Maybe[\APIName\] |
|---|
| | 383 | end |
|---|
| | 384 | trait IdStaticParam extends StaticParam |
|---|
| | 385 | in_name:Id |
|---|
| | 386 | end |
|---|
| | 387 | object If (in_clauses:List[\IfClause\], in_elseClause:Maybe[\Block\]) extends DelimitedExpr |
|---|
| | 388 | toString():String |
|---|
| | 389 | end |
|---|
| | 390 | object IfClause (in_test:GeneratorClause, in_body:Block) extends AbstractNode |
|---|
| | 391 | toString():String |
|---|
| | 392 | end |
|---|
| | 393 | object ImpliesConstraint (in_left:BoolExpr, in_right:BoolExpr) extends BinaryBoolConstraint |
|---|
| | 394 | toString():String |
|---|
| | 395 | end |
|---|
| | 396 | trait Import extends AbstractNode end |
|---|
| | 397 | object ImportApi (in_apis:List[\AliasedAPIName\]) extends Import |
|---|
| | 398 | toString():String |
|---|
| | 399 | end |
|---|
| | 400 | object ImportNames (in_api:APIName, in_aliasedNames:List[\AliasedSimpleName\]) extends ImportedNames |
|---|
| | 401 | toString():String |
|---|
| | 402 | end |
|---|
| | 403 | object ImportStar (in_api:APIName, in_except:List[\IdOrOpOrAnonymousName\]) extends ImportedNames |
|---|
| | 404 | toString():String |
|---|
| | 405 | end |
|---|
| | 406 | trait ImportedNames extends Import |
|---|
| | 407 | in_api:APIName |
|---|
| | 408 | end |
|---|
| | 409 | object InFixity extends Fixity |
|---|
| | 410 | toString():String |
|---|
| | 411 | end |
|---|
| | 412 | object Indices (in_extents:List[\ExtentRange\]) extends AbstractNode |
|---|
| | 413 | toString():String |
|---|
| | 414 | end |
|---|
| | 415 | object IntArg (in_val:IntExpr) extends StaticArg |
|---|
| | 416 | toString():String |
|---|
| | 417 | end |
|---|
| | 418 | trait IntConstraint extends WhereConstraint |
|---|
| | 419 | in_left:IntExpr |
|---|
| | 420 | in_right:IntExpr |
|---|
| | 421 | end |
|---|
| | 422 | trait IntExpr extends StaticExpr end |
|---|
| | 423 | object IntLiteralExpr (in_text:String, in_val:ZZ64) extends NumberLiteralExpr |
|---|
| | 424 | toString():String |
|---|
| | 425 | end |
|---|
| | 426 | trait IntOpExpr extends IntExpr |
|---|
| | 427 | in_left:IntExpr |
|---|
| | 428 | in_right:IntExpr |
|---|
| | 429 | end |
|---|
| | 430 | object IntParam (in_name:Id) extends IdStaticParam |
|---|
| | 431 | toString():String |
|---|
| | 432 | end |
|---|
| | 433 | object IntRef (in_name:Id) extends IntVal |
|---|
| | 434 | toString():String |
|---|
| | 435 | end |
|---|
| | 436 | trait IntVal extends IntExpr end |
|---|
| | 437 | object IntersectionType (in_elements:List[\Type\]) extends BoundType |
|---|
| | 438 | toString():String |
|---|
| | 439 | end |
|---|
| | 440 | object ItemSymbol (in_item:String) extends SyntaxSymbol |
|---|
| | 441 | toString():String |
|---|
| | 442 | end |
|---|
| | 443 | trait Juxt extends AppExpr |
|---|
| | 444 | in_multiJuxt:OpRef |
|---|
| | 445 | in_infixJuxt:OpRef |
|---|
| | 446 | in_exprs:List[\Expr\] |
|---|
| | 447 | end |
|---|
| | 448 | object KeywordExpr (in_name:Id, in_init:Expr) extends AbstractNode |
|---|
| | 449 | toString():String |
|---|
| | 450 | end |
|---|
| | 451 | object KeywordSymbol (in_token:String) extends SyntaxSymbol |
|---|
| | 452 | toString():String |
|---|
| | 453 | end |
|---|
| | 454 | object KeywordType (in_name:Id, in_type:Type) extends AbstractNode |
|---|
| | 455 | toString():String |
|---|
| | 456 | end |
|---|
| | 457 | object LEConstraint (in_left:IntExpr, in_right:IntExpr) extends IntConstraint |
|---|
| | 458 | toString():String |
|---|
| | 459 | end |
|---|
| | 460 | object LTConstraint (in_left:IntExpr, in_right:IntExpr) extends IntConstraint |
|---|
| | 461 | toString():String |
|---|
| | 462 | end |
|---|
| | 463 | trait LValue extends AbstractNode end |
|---|
| | 464 | object LValueBind (in_name:Id, in_type:Maybe[\Type\], in_mods:List[\Modifier\], in_mutable:Boolean) extends { LValue, Lhs } |
|---|
| | 465 | toString():String |
|---|
| | 466 | end |
|---|
| | 467 | object Label (in_name:Id, in_body:Block) extends DelimitedExpr |
|---|
| | 468 | toString():String |
|---|
| | 469 | end |
|---|
| | 470 | object LabelType extends Type |
|---|
| | 471 | toString():String |
|---|
| | 472 | end |
|---|
| | 473 | trait LetExpr extends Expr |
|---|
| | 474 | in_body:List[\Expr\] |
|---|
| | 475 | end |
|---|
| | 476 | object LetFn (in_body:List[\Expr\], in_fns:List[\FnDef\]) extends LetExpr |
|---|
| | 477 | toString():String |
|---|
| | 478 | end |
|---|
| | 479 | object Link (in_op:OpRef, in_expr:Expr) extends AbstractNode |
|---|
| | 480 | toString():String |
|---|
| | 481 | end |
|---|
| | 482 | trait LiteralExpr extends Primary |
|---|
| | 483 | in_text:String |
|---|
| | 484 | end |
|---|
| | 485 | object LocalVarDecl (in_body:List[\Expr\], in_lhs:List[\LValue\], in_rhs:Maybe[\Expr\]) extends LetExpr |
|---|
| | 486 | toString():String |
|---|
| | 487 | end |
|---|
| | 488 | object LooseJuxt (in_multiJuxt:OpRef, in_infixJuxt:OpRef, in_exprs:List[\Expr\]) extends Juxt |
|---|
| | 489 | toString():String |
|---|
| | 490 | end |
|---|
| | 491 | trait MathItem extends AbstractNode end |
|---|
| | 492 | object MathPrimary (in_multiJuxt:OpRef, in_infixJuxt:OpRef, in_front:Expr, in_rest:List[\MathItem\]) extends Primary |
|---|
| | 493 | toString():String |
|---|
| | 494 | end |
|---|
| | 495 | object MatrixType (in_type:Type, in_dimensions:List[\ExtentRange\]) extends AbbreviatedType |
|---|
| | 496 | toString():String |
|---|
| | 497 | end |
|---|
| | 498 | object MethodInvocation (in_obj:Expr, in_method:Id, in_staticArgs:List[\StaticArg\], in_arg:Expr) extends AppExpr |
|---|
| | 499 | toString():String |
|---|
| | 500 | end |
|---|
| | 501 | object MinusConstraint (in_left:IntExpr, in_right:IntExpr) extends IntOpExpr |
|---|
| | 502 | toString():String |
|---|
| | 503 | end |
|---|
| | 504 | trait Modifier extends AbstractNode end |
|---|
| | 505 | object ModifierAbstract extends Modifier |
|---|
| | 506 | toString():String |
|---|
| | 507 | end |
|---|
| | 508 | object ModifierAtomic extends Modifier |
|---|
| | 509 | toString():String |
|---|
| | 510 | end |
|---|
| | 511 | object ModifierGetter extends Modifier |
|---|
| | 512 | toString():String |
|---|
| | 513 | end |
|---|
| | 514 | object ModifierHidden extends Modifier |
|---|
| | 515 | toString():String |
|---|
| | 516 | end |
|---|
| | 517 | object ModifierIO extends Modifier |
|---|
| | 518 | toString():String |
|---|
| | 519 | end |
|---|
| | 520 | object ModifierOverride extends Modifier |
|---|
| | 521 | toString():String |
|---|
| | 522 | end |
|---|
| | 523 | object ModifierPrivate extends Modifier |
|---|
| | 524 | toString():String |
|---|
| | 525 | end |
|---|
| | 526 | object ModifierSettable extends Modifier |
|---|
| | 527 | toString():String |
|---|
| | 528 | end |
|---|
| | 529 | object ModifierSetter extends Modifier |
|---|
| | 530 | toString():String |
|---|
| | 531 | end |
|---|
| | 532 | object ModifierTest extends Modifier |
|---|
| | 533 | toString():String |
|---|
| | 534 | end |
|---|
| | 535 | object ModifierTransient extends Modifier |
|---|
| | 536 | toString():String |
|---|
| | 537 | end |
|---|
| | 538 | object ModifierValue extends Modifier |
|---|
| | 539 | toString():String |
|---|
| | 540 | end |
|---|
| | 541 | object ModifierVar extends Modifier |
|---|
| | 542 | toString():String |
|---|
| | 543 | end |
|---|
| | 544 | object ModifierWidens extends Modifier |
|---|
| | 545 | toString():String |
|---|
| | 546 | end |
|---|
| | 547 | object ModifierWrapped extends Modifier |
|---|
| | 548 | toString():String |
|---|
| | 549 | end |
|---|
| | 550 | object MultiFixity extends Fixity |
|---|
| | 551 | toString():String |
|---|
| | 552 | end |
|---|
| | 553 | trait Name extends AbstractNode end |
|---|
| | 554 | trait NamedType extends BaseType |
|---|
| | 555 | in_name:Id |
|---|
| | 556 | in_lexicalDepth:ZZ32 |
|---|
| | 557 | |
|---|