예제 #1
0
        public StructureBuilder(NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr)
            : base(BundleManagerBase.DefaultStructureClass, ns, loc, attr)
        {
            BaseClass = new UserType (typeof (StructureTemplate));

            ns.SetUserParams (this);
        }
예제 #2
0
	public BGProviderBuilder (string name, NamespaceBuilder ns) : base (ns)
	{
	    if (Structure[name] != StructureParameterKind.Basis)
		throw ExHelp.App ("No such basis parameter {0} for provider", name);

	    basisparam = name;
	}
예제 #3
0
파일: Driver.cs 프로젝트: emtees/old-code
	public NamespaceBuilder GetNamespace (string name)
	{
	    if (!namespaces.ContainsKey (name))
		namespaces[name] = new NamespaceBuilder (name, new TypeResolveContext (this));

	    return namespaces[name];
	}
예제 #4
0
	public StructureBuilder (NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr) 
	    : base (BundleManagerBase.DefaultStructureClass, ns, loc, attr)
	{
	    BaseClass = new UserType (typeof (StructureTemplate));

	    ns.SetUserParams (this);
	}
예제 #5
0
	    public TheResult (string name, NamespaceBuilder ns, string ename, CodeLinePragma loc, TypeAttributes attr)
		: base (name, ns, loc, attr)
	    {
		etype = new UserType (ename);

		BaseClass = new UserType (typeof (EnumResult<>));
		BaseClass.AddTypeArgument (etype);
	    }
예제 #6
0
	void NewNamespace (string name)
	{
	    // We cannot reuse because different namespace {} clauses
	    // of the same value may have different usings.

	    cur_ns = new NamespaceBuilder (name, new TypeResolveContext (driver));
	    namespaces.Add (cur_ns);
	}
예제 #7
0
        void NewNamespace(string name)
        {
            // We cannot reuse because different namespace {} clauses
            // of the same value may have different usings.

            cur_ns = new NamespaceBuilder(name, new TypeResolveContext(driver));
            namespaces.Add(cur_ns);
        }
예제 #8
0
	public MetaRuleBuilder (string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr)
	{
	    rb = new RuleBuilder (name, ns, loc, attr);
	    tmpl = new RuleTemplateBuilder (name + "RTemplate", rb, ns, loc, attr);

	    ns.AddMetaRule (this);
	    BaseClass = RuleType;
	}
예제 #9
0
        public MetaRuleBuilder(string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr)
        {
            rb   = new RuleBuilder(name, ns, loc, attr);
            tmpl = new RuleTemplateBuilder(name + "RTemplate", rb, ns, loc, attr);

            ns.AddMetaRule(this);
            BaseClass = RuleType;
        }
예제 #10
0
            public TheResult(string name, NamespaceBuilder ns, string ename, CodeLinePragma loc, TypeAttributes attr)
                : base(name, ns, loc, attr)
            {
                etype = new UserType(ename);

                BaseClass = new UserType(typeof(EnumResult <>));
                BaseClass.AddTypeArgument(etype);
            }
예제 #11
0
	public EnumResultBuilder (string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr)
	{
	    if (name == null)
		throw new ArgumentNullException ();
	    
	    enumer = new TheEnum (name, ns, loc, attr);
	    result = new TheResult (name + "Result", ns, name, loc, attr);
	}
예제 #12
0
파일: Driver.cs 프로젝트: retahc/old-code
        public NamespaceBuilder GetNamespace(string name)
        {
            if (!namespaces.ContainsKey(name))
            {
                namespaces[name] = new NamespaceBuilder(name, new TypeResolveContext(this));
            }

            return(namespaces[name]);
        }
예제 #13
0
        public BGProviderBuilder(string name, NamespaceBuilder ns) : base(ns)
        {
            if (Structure[name] != StructureParameterKind.Basis)
            {
                throw ExHelp.App("No such basis parameter {0} for provider", name);
            }

            basisparam = name;
        }
예제 #14
0
        public EnumResultBuilder(string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr)
        {
            if (name == null)
            {
                throw new ArgumentNullException();
            }

            enumer = new TheEnum(name, ns, loc, attr);
            result = new TheResult(name + "Result", ns, name, loc, attr);
        }
예제 #15
0
	protected TypeExpressedItem (string namebase, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attrs)
	{
	    if (namebase == null)
		throw new ArgumentNullException ();

	    this.namebase = namebase;
	    location = loc;
	    this.attrs = attrs;

	    this.ns = ns;
	    ns.AddItem (this);
	}
예제 #16
0
	public StructureElement (NamespaceBuilder ns)
	{
	    if (!(ns.Params is StructureBuilder))
		throw new Exception ("Trying to instantiate a structure element in a " +
				     "namespace that has already had its structure template " +
				     "defined.");

	    this.sb = (StructureBuilder) ns.Params;
	    this.ns = ns;

	    sb.AddElement (this);
	}
예제 #17
0
        void CloseNamespace()
        {
            if (cur_ns.Params == null)
            {
                // If we haven't declared any parameters for this space
                // yet, and we don't reference a library that has,
                // create our own parameterless structurebuilder.
                new StructureBuilder(cur_ns, lexer.LinePragma, 0);
            }

            cur_ns = null;
        }
예제 #18
0
        protected TypeExpressedItem(string namebase, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attrs)
        {
            if (namebase == null)
            {
                throw new ArgumentNullException();
            }

            this.namebase = namebase;
            location      = loc;
            this.attrs    = attrs;

            this.ns = ns;
            ns.AddItem(this);
        }
예제 #19
0
        public StructureElement(NamespaceBuilder ns)
        {
            if (!(ns.Params is StructureBuilder))
            {
                throw new Exception("Trying to instantiate a structure element in a " +
                                    "namespace that has already had its structure template " +
                                    "defined.");
            }

            this.sb = (StructureBuilder)ns.Params;
            this.ns = ns;

            sb.AddElement(this);
        }
예제 #20
0
        void AddNamespaceParam(string ns)
        {
            // FIXME: we can't distinguish references to A.Foo and B.Foo!
            // Need a syntax for this.

            UserType t = new UserType(NamespaceBuilder.MakeStructureName(ns));

            string paramname = ns;
            int    i         = ns.LastIndexOf('.');

            if (i >= 0)
            {
                paramname = ns.Substring(i + 1);
            }

            cur_nsstruct.AddStructureParam(t, paramname, ns);
        }
예제 #21
0
 public TheEnum(string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr) :
     base(name, ns, loc, attr)
 {
     BaseClass = new UserType(typeof(int));
 }
예제 #22
0
	public StructureBoundItem (string name, NamespaceBuilder ns, CodeLinePragma loc, 
				   TypeAttributes attr) : base (name, ns, loc, attr)
	{
	    this.ns = ns;
	}
예제 #23
0
	public RuleBuilder (string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr) : 
	    base (name, ns, loc, attr)
	{
	    BaseClass = RuleClass;
	    fp.Add (name);
	}
예제 #24
0
 public MatcherBuilder(NamespaceBuilder ns, CodeLinePragma loc) :
     base("RegexMatcher", ns, loc, TypeAttributes.Public)
 {
     BaseClass = new UserType(typeof(RegexMatcher));
     serial    = matcher_serial++;
 }
예제 #25
0
 public RuleBuilder(string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr) :
     base(name, ns, loc, attr)
 {
     BaseClass = RuleClass;
     fp.Add(name);
 }
예제 #26
0
	public MatcherBuilder (NamespaceBuilder ns, CodeLinePragma loc) : 
	    base ("RegexMatcher", ns, loc, TypeAttributes.Public)
	{
	    BaseClass = new UserType (typeof (RegexMatcher));
	    serial = matcher_serial++;
	}
예제 #27
0
 public SourcefileRuleBuilder(string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr) :
     base(name, ns, loc, attr)
 {
     BaseClass = new UserType(typeof(SourcefileRule));
     fp.Add(name);
 }
예제 #28
0
	public RuleTemplateBuilder (string name, RuleBuilder rb, NamespaceBuilder ns, CodeLinePragma loc,
				    TypeAttributes attr) : base (name, ns, loc, attr)
	{
	    this.rb = rb;
	}
예제 #29
0
	// A TemplateBuilder may never actually reference a structure.
	// In that case, UseStructure () isn't called and UsesStructure
	// is therefore false.

	public TemplateBuilder (string name, NamespaceBuilder ns, CodeLinePragma loc,
				TypeAttributes attr) : base (name, ns, loc, attr)
	{
	    BaseClass = TTType;
	}
예제 #30
0
	void CloseNamespace ()
	{
	    if (cur_ns.Params == null)
		// If we haven't declared any parameters for this space
		// yet, and we don't reference a library that has, 
		// create our own parameterless structurebuilder.
		new StructureBuilder (cur_ns, lexer.LinePragma, 0);

	    cur_ns = null;
	}
예제 #31
0
	public SourcefileRuleBuilder (string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr) : 
	    base (name, ns, loc, attr)
	{
	    BaseClass = new UserType (typeof (SourcefileRule));
	    fp.Add (name);
	}
예제 #32
0
	// FIXME: Resurrect the 'implementation code' idea?
	// It was kind of useful I think.

	public ResultBuilder (string name, NamespaceBuilder ns, CodeLinePragma loc, TypeAttributes attr) : 
	    base (name, ns, loc, attr)
	{
	    BaseClass = new UserType (typeof (Result));
	}
예제 #33
0
 public StructureBoundItem(string name, NamespaceBuilder ns, CodeLinePragma loc,
                           TypeAttributes attr) : base(name, ns, loc, attr)
 {
     this.ns = ns;
 }
예제 #34
0
        // A TemplateBuilder may never actually reference a structure.
        // In that case, UseStructure () isn't called and UsesStructure
        // is therefore false.

        public TemplateBuilder(string name, NamespaceBuilder ns, CodeLinePragma loc,
                               TypeAttributes attr) : base(name, ns, loc, attr)
        {
            BaseClass = TTType;
        }
예제 #35
0
 public RuleTemplateBuilder(string name, RuleBuilder rb, NamespaceBuilder ns, CodeLinePragma loc,
                            TypeAttributes attr) : base(name, ns, loc, attr)
 {
     this.rb = rb;
 }