Ejemplo n.º 1
0
        public void Parse(LatexExportParser parent, StreamWriter output, ref int currLine, ITreeEnumerator <string> dataEnumerator)
        {
            int forBegin = currLine + 1;

            dataEnumerator.MoveIn();

            while (dataEnumerator.MoveNext())
            {
                currLine = forBegin;

                while (parent.GetLine(currLine) != null && !parent.GetLine(currLine).Contains("%# end for #%"))
                {
                    foreach (var parser in parent.SectionParsers)
                    {
                        if (!parser.CanParse(parent.GetLine(currLine)))
                        {
                            continue;
                        }

                        parser.Parse(parent, output, ref currLine, dataEnumerator);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void Parse(LatexExportParser parent, StreamWriter output, ref int currLine, ITreeEnumerator <string> dataEnumerator)
        {
            if (!CanParse(parent.GetLine(currLine)))
            {
                return;
            }

            output.WriteLine(parent.GetLine(currLine));
        }
Ejemplo n.º 3
0
        public void Parse(LatexExportParser parent, StreamWriter output, ref int currLine, ITreeEnumerator <string> dataEnumerator)
        {
            string token = parent.GetLine(currLine);

            if (token.Contains("%# InputCurrentData #%"))
            {
                if (dataEnumerator.Current != "")
                {
                    output.WriteLine(dataEnumerator.Current);
                }
            }
            else if (token.Contains("%# InputNextData #%"))
            {
                if (!dataEnumerator.MoveNext())
                {
                    throw new IndexOutOfRangeException("No printable data found");
                }

                if (dataEnumerator.Current != "")
                {
                    output.WriteLine(dataEnumerator.Current);
                }
            }
            else if (token.Contains("%# SkipData #%"))
            {
                if (!dataEnumerator.MoveNext())
                {
                    throw new IndexOutOfRangeException("No printable data found");
                }
            }
        }