help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GLR parsing problem


From: Ramaswamy
Subject: GLR parsing problem
Date: Thu, 13 Feb 2003 17:51:56 +0530

Hi,
     I have a problem with merging in bisons GLR parsing mechanism. The following is the grammar (which btw I did not design this grammar, someone else is to blame and I dun have enough time to redesign the grammar) where I am facing some problem (I have shown only the relavent portion).

Assignment: ObjectAssignment | ValueAssignment
 
ObjectAssignment: LC_IDENTIFIER TYPE_REFERENCE ASGN ObjectDefn %merge<Merge>
 
ValueAssignment : LC_IDENTIFIER TYPE_REFERENCE ASGN Value  %merge<Merge>
 
Value: SequenceOfOrSetOfValue %merge<cacheAmbiguity>
Value: CharacterStringValue   %merge<cacheAmbiguity>

    Unfortunately ObjectDefn, SequenceOfOrSetOfValue and CharacterStringValue all can parse one particular structure of input. So I decide to %merge them but the order in which the Merge fn is called is not very clear to me. Since there r 3 ways to parse the input 3 stacks exist and at the end since all of them end at the same state state 1 and 2 are merged with stack 0. Thus I expect 2 calls to Merge fn. But I got this sequence for the input " { 1, 2 } " -
 
<<SequenceOrSetOfValue>>
<<CharacterStringValue>>
 Merge( SequenceOfOrSetOfValue , CharacterStringValue0 ) -> SC0

<<ValAssgn:SC0>>
<<CharacterStringValue1>>
<<ValAssgn:CharacterStringValue1>>
 Merge( SC0 , CharacterStringValue1 ) -> SC1

<<ObjAssgn:9:ObjectDefn>>
 Merge( SC1 , ObjectDefn )
 
    From my understanding I expected the second and 3rd part of the sequence to be somethin like -
 
<<SequenceOrSetOfValue>>
<<CharacterStringValue>>
 Merge( SequenceOfOrSetOfValue , CharacterStringValue0 ) -> SC0

<<ValAssgn:SC0>>
<<ObjAssgn:ObjectDefn>>
 Merge( SC0 , ObjectDefn ) -> SC1
 
   Cud any one could explain why this is happening or cud give reference to some detailed use of %merge. Thankin in advance.
 
Regds
Ram

reply via email to

[Prev in Thread] Current Thread [Next in Thread]