Пример #1
0
 @Override
 public final void exitFunctionType(TypeParser.FunctionTypeContext ctx) {
   Type[] params = this.popParams();
   this.addParam(
       Type.fun(
           params[0], params[1])); // We can do this because the grammer makes sure that a function
   // always has two arguments.
 }
Пример #2
0
 @Override
 public final void exitTypeConstructor(TypeParser.TypeConstructorContext ctx) {
   this.addParam(Type.con(ctx.getText()));
 }
Пример #3
0
 @Override
 public final void exitListType(TypeParser.ListTypeContext ctx) {
   this.addParam(Type.listOf((this.popParams()[0])));
 }
Пример #4
0
 @Override
 public final void exitTupleType(TypeParser.TupleTypeContext ctx) {
   this.addParam(Type.tupleOf(this.popParams()));
 }
Пример #5
0
 @Override
 public void exitAppliedType(TypeParser.AppliedTypeContext ctx) {
   Type[] types = this.popParams();
   this.addParam(Type.app(types));
 }
Пример #6
0
 @Override
 public final void exitConstantType(TypeParser.ConstantTypeContext ctx) {
   Type[] types = this.popParams();
   this.addParam(Type.app(types));
 }