Ejemplo n.º 1
0
        protected override bool Visit(ASTProcedureType node)
        {
            var arguments = new List <ProcedureType.Argument>();

            foreach (var arg in node.Arguments)
            {
                if (!Visit(arg))
                {
                    return(false);
                }
                if (!(arg.TypeInfo is TypeType c) || c.Type.Equals(Cache.GetUnknown()))
                {
                    Error(arg.Position, "Argument did not specify a valid type.");
                    return(false);
                }

                arguments.Add(new ProcedureType.Argument(null, c.Type));
            }

            if (!Visit(node.Return))
            {
                return(false);
            }

            // TODO: Cache procedure types?
            node.TypeInfo = Cache.GetType(new ProcedureType(arguments, node.Return.TypeInfo));
            return(true);
        }
Ejemplo n.º 2
0
 protected override bool Visit(ASTProcedureType node)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 protected abstract bool Visit(ASTProcedureType node);