Esempio n. 1
0
        public FunctionDef(LatteParser.FunctionDefContext context)
        {
            Type  = context.type();
            Id    = context.ID().GetText();
            Block = new Block(context.block());

            var arg = context.arg();

            if (arg == null)
            {
                Args = new List <Arg>();
            }
            else
            {
                var idType = arg.ID().Zip(arg.type(), (id, type) => (id, type));
                Args = idType.Select(x => new Arg(x.type, x.id.GetText())).ToList();
            }
        }
Esempio n. 2
0
 public override void EnterFunctionDef(LatteParser.FunctionDefContext context)
 {
     EnterFunctionDef(new FunctionDef(context), context.start.Line, context.block(), context.arg());
 }