Detecting a conflict

Top  Previous  Next

Examples > E-mail address > Detecting a conflict

 

So far no problems occurred and the project seems to be ready. But if you select the start rule mailbox and parse it two errors are shown:

 

mailbox: LL(1) Error: "\"" is the start of several alternatives

mailbox: LL(1) Error: "ATOM" is the start of several alternatives

 

If such a LL(1)-conflict exists, the actual text don't suffices for the parser to decide, which rule should be applied next.

The TextTransformer - in contrast to some other related tools - helps to discover such errors. But to remove them, you need some understanding of the grammar, you are developing and some power of deduction.

 

In the mailbox production:

 

addr_spez | phrase route_addr

 

the alternatives are beginning with addr_spez and phrase. If you select addr_spez in the navigation tree at the right side of the screen and click the right mouse button, the first set of this production can be shown:

 

Email_Firstset_en

 

If you do the same with the phrase production, you will see the same First set.

If you look at the definitions of these productions, the cause of the conflict still isn't clear:

 

addr_spez ::= local_part "@" domain

 

phrase ::= word+

 

But if you go down another step, the conflict becomes obvious:

 

local_part ::= word ("." word)*

 

word ::= ATOM | quoted_string

 

Indirectly as well addr_spez as phrase are beginning with word.

 

 

 

 

 

 



This page belongs to the TextTransformer Documentation

Home  Content  German