Inheritance: ParseNode
示例#1
0
        private BibtexFile convertParseNode(ParseNode node)
        {
            Nodes.BibtexFile parseFile = (Nodes.BibtexFile)node;

            BibtexFile bibtex = new BibtexFile();

            foreach (Entry entry in parseFile.Entries)
            {
                if (entry.Type == "String")
                {
                    bibtex.StringDefinitions.Add(entry.Tags.First().Key, entry.Tags.First().Value);
                }
                else
                {
                    BibtexEntry bibtexEntry = new BibtexEntry {
                        Key = entry.Key, Type = entry.Type
                    };

                    entry.Tags.ToList().ForEach(x => bibtexEntry.Tags.Add(x.Key, x.Value));

                    bibtex.Entries.Add(bibtexEntry);
                }
            }

            return(bibtex);
        }
示例#2
0
        private ParseNode ParseInput(Tokenizer.Tokenizer tokenizer)
        {
            Nodes.BibtexFile file = new Nodes.BibtexFile();

            while (!tokenizer.EndOfInput)
            {
                AbstractToken token = tokenizer.NextToken();

                if (token.GetType() == typeof(At))
                {
                    file.Entries.Add(Entry(tokenizer));
                }
            }

            return(file);
        }
示例#3
0
        private BibtexFile convertParseNode(ParseNode node)
        {
            Nodes.BibtexFile parseFile = (Nodes.BibtexFile) node;

            BibtexFile bibtex = new BibtexFile();

            foreach (Entry entry in parseFile.Entries)
            {
                if (entry.Type == "String")
                {
                    bibtex.StringDefinitions.Add(entry.Tags.First().Key, entry.Tags.First().Value);
                }
                else
                {
                    BibtexEntry bibtexEntry = new BibtexEntry { Key = entry.Key, Type = entry.Type };

                    entry.Tags.ToList().ForEach(x => bibtexEntry.Tags.Add(x.Key, x.Value));

                    bibtex.Entries.Add(bibtexEntry);
                }
            }

            return bibtex;
        }
示例#4
0
        private ParseNode ParseInput(Tokenizer.Tokenizer tokenizer)
        {
            Nodes.BibtexFile file = new Nodes.BibtexFile();

            while (!tokenizer.EndOfInput)
            {
                AbstractToken token = tokenizer.NextToken();

                if (token.GetType() == typeof (At))
                {
                    file.Entries.Add(Entry(tokenizer));
                }
            }

            return file;
        }