Example #1
0
 public override object VisitArrayIndexNode(ArrayIndexNode n)
 {
     Visit(n.array);
     Visit(n.index);
     n.Type = n.array.Type.ArrayType;
     return(null);
 }
Example #2
0
            public override LData VisitArrayIndexNode(ArrayIndexNode n)
            {
                LData arr = Visit(n.array);
                LData idx = Visit(n.index);

                return(arr.GetValue()._arr[idx.GetValue()]);
            }
Example #3
0
        public virtual T VisitArrayIndexNode(ArrayIndexNode n)
        {
            T a = n.array.Accept(this);
            T b = n.index.Accept(this);

            return(default(T));
        }
Example #4
0
            public override object VisitArrayIndexNode(ArrayIndexNode n)
            {
                Visit(n.array);
                Visit(n.index);

                semanticChecker.CheckAndReport(n.array.Type.Kind == TypeSymbol.TypeKind.POINTER || n.array.Type.Kind == TypeSymbol.TypeKind.ARRAY, n.sourceLoc, "Trying to index into illegal type");
                semanticChecker.CheckAndReport(n.index.Type.Equals(TypeSymbol.INT_SYMBOL), n.sourceLoc, "Index not typeof int");
                return(null);
            }
Example #5
0
        public object VisitArrayIndexNode(ArrayIndexNode n)
        {
            WriteLine(n.kind + " - " + n.Type);
            Indent();
            Visit(n.array);
            Visit(n.index);
            Dedent();

            return(null);
        }
Example #6
0
 public override MIPSRegister VisitArrayIndexNode(ArrayIndexNode n)
 {
     return(base.VisitArrayIndexNode(n));
 }
Example #7
0
 public override LLVMRegister VisitArrayIndexNode(ArrayIndexNode n)
 {
     throw new NotImplementedException();
 }