コード例 #1
0
 public TypeDenoter VisitArrayTypeDenoter(ArrayTypeDenoter ast, Void arg)
 {
     ast.Type = ast.Type.Visit(this);
     CheckAndReportError(ast.IntegerLiteral.Value != 0, "arrays must not be empty",
                         ast.IntegerLiteral);
     return(ast);
 }
コード例 #2
0
        public int VisitArrayTypeDenoter(ArrayTypeDenoter ast, Frame frame)
        {
            int typeSize;

            if (ast.Entity == null)
            {
                var elemSize = ast.Type.Visit(this, null);
                typeSize   = ast.IntegerLiteral.Value * elemSize;
                ast.Entity = new TypeRepresentation(typeSize);
                Encoder.WriteTableDetails(ast);
            }
            else
            {
                typeSize = ast.Entity.Size;
            }
            return(typeSize);
        }