Beispiel #1
0
 public static void Rule(Program lhs, OptionalProgramStatement optionalProgramStatement, AdditionalProgramStatements additionalProgramStatements)
 {
     if (optionalProgramStatement.CodeSentence != null)
     {
         lhs.CodeSentences.Add(optionalProgramStatement.CodeSentence);
     }
     lhs.CodeSentences.AddRange(additionalProgramStatements.CodeSentences);
 }
Beispiel #2
0
        internal CodeSentence[] ParseText(string text)
        {
            m_terminalReader.Open(text);

            Grammar.Program program = (Grammar.Program)m_parser.Parse(m_terminalReader);
            if (program == null)
            {
                return(null);
            }

            return(program.CodeSentences.ToArray());
        }