How does the parser for infix notation detect a missing multiplication sign?

I am writing a parser that parses mathematical expressions based on a syntax diagram very similar to this one .

I haven't found a way to handle the missing multiplication sign (like in 3(x+y)

). Where in the syntax diagram should I handle this?

0


source to share


1 answer


You would make it *

optional in the definition term

.

ASCII Chart:



o-->-->--[factor]->-->--o
    /               \
    \               /
     ---<--[*]--<---
         \     /
          --<--

      

+1


source







All Articles