Stream[F, Expr]out, i.e. parse expression by expression
Exprmaybe has sub-exprs that I want to get later
I'm wondering how feasible something like this is? I'm recalling your ProfF example from memory and changing it to Stream and Vector, but I may have gotten something else wrong
trait Expr case class FunctionF[F[_]](name: String, subExprs: Stream[F, Expr]) case class Function(name: String, subExprs: Vector[Expr]) extends Expr
Is it possible to implement arithmetic grammar WITH substitution and division in atto?
Grammar like this one (I know it's left recursive)
<Exp> ::= <Exp> + <Term> | <Exp> - <Term> | <Term> <Term> ::= <Term> * <Factor> | <Term> / <Factor> | <Factor> <Factor> ::= int | ( <Exp> )
So far I have only seen grammars without substitution and division. They require left-associativity and I guess it's a reason they are often left out in examples.
BLAH BLAH This is some 42 text 123\n
[BLAH][BLAH][This is some 42 text]