示例#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));
 }