public override void Visit(ListConst n) // may need implpamentation /*foreach (AST ast in n.declarings) { * ast.accept(this); * }*/ { }
public override void Visit(ListConst n) { foreach (AST ast in n.declarings) { ast.accept(this); } }
public override void Visit(ListConst n) { emit("{"); if (n.declarings.Count > 0) { AST first = n.declarings[0]; foreach (AST ast in n.declarings) { if (first != ast) { emit(", "); } ast.accept(this); } } emit("}"); }
public override void Visit(ListConst n) { string type = AST.LIST.ToString(); int elementType = -1; foreach (AST ast in n.declarings) { ast.accept(this); if (elementType == -1) { elementType = ast.type; } else if (ast.type != elementType) { Error($"List in {scopeLevel} not of same type"); } } if (elementType != -1) { type += elementType.ToString(); } n.type = int.Parse(type); }