package cs241e.assignments

import cs241e.scanparse.DFAs.Token
import cs241e.scanparse.Grammars._

object A8 {
  /* Hint: If you find the implementations in this file tedious, consider writing yourself some helper methods. */

  /** A sample grammar. */
  val grammar = parseGrammar(
    """
S BOF A EOF
A x
A A x
    """)

  /** A parse tree of the string `BOF x EOF` generated by `grammar`. */
  val oneX =
    new Tree(Token("S"), Seq(
      new Tree(Token("BOF")),
      new Tree(Token("A"), Seq(
        new Tree(Token("x"))
      )),
      new Tree(Token("EOF"))
    ))

  /** A parse tree of the string `BOF x x EOF` generated by `grammar`. */
  lazy val twoXes = ???

  /** A parse tree of the string `BOF x x x EOF` generated by `grammar`. */
  lazy val threeXes = ???

  /** A sample ambiguous grammar. */
  val ambiguousGrammar = parseGrammar(
    """
S BOF A EOF
A x
A A x A
    """)

  /** A parse tree of some string for which `ambiguousGrammar` is ambiguous. */
  lazy val tree1 = ???

  /** A **different** parse tree of the **same** string as `tree1` according to `ambiguousGrammar`. */
  lazy val tree2 = ???
}