public virtual T VisitConstListExprNode(ConstListExprNode n) { for (int i = 0; i < n.ListValue.Count; i++) { n.ListValue[i].Accept(this); } return(default(T)); }
public object VisitConstListExprNode(ConstListExprNode n) { WriteLine(n.kind); Indent(); foreach (Expression e in n.ListValue) { Visit(e); } Dedent(); return(null); }
public override MIPSRegister VisitConstListExprNode(ConstListExprNode n) { var reg = GetMIPSRegister(); emit.EmitMalloc(reg, (short)(n.ListValue.Count + 1)); for (int i = 0; i < n.ListValue.Count; i++) { var idx = Gen(n.ListValue[i]); emit.EmitLoadStore("sw", idx, (short)((i + 1) * 4), reg); rm.ReleaseRegister(idx); } return(reg); }
public override object VisitConstListExprNode(ConstListExprNode n) { if (n.Type.ArrayType.Kind == TypeSymbol.TypeKind.FUNCTION) { foreach (var e in n.ListValue) { } } else { foreach (Expression e in n.ListValue) { Visit(e); } } semanticChecker.CheckAndReport(n.ListValue.All((e) => e.Type.Match(n.Type.ArrayType)), n.sourceLoc, "At least one element has a different Type of the others"); return(null); }
public override object VisitConstListExprNode(ConstListExprNode n) { if (n.ListValue.Count > 0) { TypeSymbol arrType = null; foreach (Expression e in n.ListValue) { Visit(e); var et = e.Type; if (arrType == null) { arrType = et; } else { if (et.Kind == TypeSymbol.TypeKind.INFER && et.inferOptions != null && et.inferOptions.Count > 0) { foreach (var ts in et.inferOptions) { if (ts.Match(arrType)) { e.Type = ts; break; } } } } } n.Type = TypeSymbol.ARRAY_SYMBOL(arrType); } else { n.Type = TypeSymbol.INFER_SYMOBOL("[]"); } return(null); }
public override LLVMRegister VisitConstListExprNode(ConstListExprNode n) { throw new NotImplementedException(); }
public override LData VisitConstListExprNode(ConstListExprNode n) { var arr = new LArray(n.ListValue.Select(e => Visit(e)).ToArray()); return(arr); }