コード例 #1
0
ファイル: ClassDefinition.cs プロジェクト: TimJSwan89/crayon
        public ClassDefinition(
            Token classToken,
            Token nameToken,
            IList <Token> subclassTokens,
            IList <string> subclassNames,
            string ns,
            TopLevelConstruct owner,
            Library library,
            Token staticToken,
            Token finalToken,
            FileScope fileScope)
            : base(classToken, owner, fileScope)
        {
            this.Library = library;
            this.ClassID = ClassDefinition.classIdAlloc++;

            this.Namespace             = ns;
            this.NameToken             = nameToken;
            this.BaseClassTokens       = subclassTokens.ToArray();
            this.BaseClassDeclarations = subclassNames.ToArray();
            this.StaticToken           = staticToken;
            this.FinalToken            = finalToken;

            if (staticToken != null && this.BaseClassTokens.Length > 0)
            {
                throw new ParserException(staticToken, "Class cannot be static and have base classes or interfaces.");
            }
        }
コード例 #2
0
 public FunctionDefinition(
     Token functionToken,
     Library library,
     TopLevelConstruct nullableOwner,
     bool isStaticMethod,
     Token nameToken,
     IList <Annotation> functionAnnotations,
     string namespyace,
     FileScope fileScope)
     : base(functionToken, nullableOwner, fileScope)
 {
     this.Library        = library;
     this.IsStaticMethod = isStaticMethod;
     this.Namespace      = namespyace;
     this.NameToken      = nameToken;
     this.annotations    = new Dictionary <string, Annotation>();
     foreach (Annotation annotation in functionAnnotations)
     {
         this.annotations[annotation.Type] = annotation;
     }
     this.MemberID = -1;
 }
コード例 #3
0
ファイル: ConstStatement.cs プロジェクト: TimJSwan89/crayon
 public ConstStatement(Token constToken, Token nameToken, string ns, TopLevelConstruct owner, Library library, FileScope fileScope)
     : base(constToken, owner, fileScope)
 {
     this.Library   = library;
     this.NameToken = nameToken;
     this.Name      = nameToken.Value;
     this.Namespace = ns;
 }
コード例 #4
0
ファイル: Namespace.cs プロジェクト: TimJSwan89/crayon
 public Namespace(Token namespaceToken, string name, TopLevelConstruct owner, Library library, FileScope fileScope)
     : base(namespaceToken, owner, fileScope)
 {
     this.Library = library;
     this.Name    = name;
 }
コード例 #5
0
ファイル: ImportStatement.cs プロジェクト: TimJSwan89/crayon
 public ImportStatement(Token importToken, string path, Library callingLibrary, FileScope fileScope)
     : base(importToken, null, fileScope)
 {
     this.Library    = callingLibrary;
     this.ImportPath = path;
     fileScope.Imports.Add(this);
 }
コード例 #6
0
 public EnumDefinition(Token enumToken, Token nameToken, string ns, TopLevelConstruct owner, Library library, FileScope fileScope)
     : base(enumToken, owner, fileScope)
 {
     this.Library   = library;
     this.NameToken = nameToken;
     this.Name      = nameToken.Value;
     this.Namespace = ns;
 }
コード例 #7
0
 public TopLevelConstruct(Token firstToken, TopLevelConstruct owner, FileScope fileScope)
     : base(firstToken, owner)
 {
     this.FileScope = fileScope;
 }