예제 #1
0
        private void ParseImportPackages(List <SectionImportRaw.PackageRaw> packages, List <LexToken> packagesTokens)
        {
            ImportPackageRawParser             packageParser = new ImportPackageRawParser();
            List <SectionImportRaw.PackageRaw> package1      = packageParser.Parse(packagesTokens, this.fileContext);

            packages.AddRange(package1);
        }
예제 #2
0
        private void ParseUseClass(SectionUseRaw ast, List <LexToken> sourceTokens)
        {
            ImportPackageRawParser packageParser = new ImportPackageRawParser();

            for (int i = 0; i < sourceTokens.Count; i++)
            {
                LexToken token = sourceTokens[i];
                if (token.IsKind(TokenKindKeyword.Ident))
                {
                    ast.Parts.Add((LexTokenText)token);
                }
                else if (token.IsKind(TokenKindSymbol.Comma))
                {
                }
                else
                {
                    error(token, string.Format("使用的'{0}'不是正确的类型名称", token.Text));
                }
            }
        }