Ejemplo n.º 1
0
        /// <summary>
        /// Add unknown-type declarations
        /// </summary>
        public void AddDecls(DeclarationList fs, Scope s = 0)
        {
            if (fs == null)
            {
                return;
            }

            if (s != 0)
            {
                foreach (IScopedDeclaration d in fs)
                {
                    d.SetScope(s);
                }
            }

            foreach (var d in fs)
            {
                if (d is MethodDeclaration)
                {
                    decls.Add(d);
                }
                else if (d is PropertyDeclaration)                      // a property is a field too
                {
                    properties.Add(d);
                }
                else if (d is FieldDeclaration)                 // a property is a field too
                {
                    fields.Add(d);
                }
                else
                {
                    ErrorInternal("Unknown Declaration in ObjectSection AddDecls");
                }
            }
        }
Ejemplo n.º 2
0
 public VariantDeclaration(String id, VariableType t, DeclarationList varfields)
     : base(id, t)
 {
     // TODO
     ///	if (!(t is IOrdinalType))
     //		throw new TypeRequiredException("Ordinal");
     this.varfields = varfields;
 }
Ejemplo n.º 3
0
 public ArrayProperty(String ident, TypeNode type, DeclarationList indexes,
                      PropertySpecifiers specs, bool def)
     : base(ident, type, specs)
 {
     this.indexes    = indexes;
     this.specifiers = specs;
     this.isDefault  = def;
 }
Ejemplo n.º 4
0
 public ParametersSection(DeclarationList decls = null)
     : base(decls)
 {
     returnVar = null;
     if (decls == null)
     {
         decls = new DeclarationList();
     }
 }
Ejemplo n.º 5
0
 public void AddFields(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (FieldDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     fields.Add(fs);
 }
Ejemplo n.º 6
0
 public void AddMethods(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (MethodDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     decls.Add(fs);
 }
Ejemplo n.º 7
0
 public void AddProperties(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (PropertyDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     properties.Add(fs);
 }
Ejemplo n.º 8
0
 public Section(DeclarationList dls)
 {
     decls = dls;
     if (decls == null)
     {
         decls = new DeclarationList();
     }
     else
     {
         foreach (var d in decls)
         {
             if (d is CallableDeclaration)
             {
                 (d as CallableDeclaration).declaringSection = this;
             }
         }
     }
 }
Ejemplo n.º 9
0
        // Kept in the baseclass, 'decls' list
        //	public DeclarationList methods;

        public ObjectSection(DeclarationList fs = null, DeclarationList ds = null, Scope s = Scope.Published)
            : base(new DeclarationList())
        {
            fields = fs;
            if (fields == null)
            {
                fields = new DeclarationList();
            }
            properties = new DeclarationList();

            AddDecls(ds, s);                    // methods and properties

            if (Enum.IsDefined(typeof(Scope), s))
            {
                foreach (FieldDeclaration d in fields)
                {
                    d.SetScope(s);
                }
            }
        }
Ejemplo n.º 10
0
 public VariantDeclaration(String id, RangeType t, DeclarationList varfields)
     : this(id, (VariableType)t, varfields)
 {
 }
Ejemplo n.º 11
0
 public ImplementationSection(NodeList uses, DeclarationList decls) : base(uses, decls)
 {
 }
Ejemplo n.º 12
0
 public ProgramSection(NodeList uses, DeclarationList decls, BlockStatement code)
     : base(uses, decls)
 {
     this.block = code;
 }
Ejemplo n.º 13
0
 public RoutineSection(DeclarationList decls, Statement block)
     : base(decls)
 {
     this.block = block;
 }
Ejemplo n.º 14
0
 public LibraryNode(String name, NodeList uses, DeclarationList decls, BlockStatement body)
     : base((name == null)? "$untitled$" : name)
 {
     section = new ProgramSection(uses, decls, body);
 }
Ejemplo n.º 15
0
 public Section()
 {
     decls = new DeclarationList();
 }
Ejemplo n.º 16
0
 public InterfaceSection(NodeList uses, DeclarationList decls) : base(uses, decls)
 {
 }
Ejemplo n.º 17
0
 public VarEntryDeclaration(Expression tagvalue, DeclarationList fields)
     : base(null, null)                  // type must be later set to the variant type
 {
     this.tagvalue = tagvalue;
     this.fields   = new RecordType(fields);
 }
Ejemplo n.º 18
0
 public RecordType(DeclarationList compTypes)
 {
     this.compTypes = compTypes;
 }
Ejemplo n.º 19
0
 public TopLevelDeclarationSection(NodeList uses, DeclarationList decls)
     : base(decls)
 {
     this.uses = uses;
 }