[clean-list] parsing ambiguity

Jigang Sun Jigang.Sun at student.paisley.ac.uk
Wed Oct 18 00:49:17 MEST 2006


Please have a look at the following grammar extracted from language report v2.1

Application = {BrackGraph}+
    | GraphExpr Operator GraphExpr
(the above rule could be left factorized as 
Application = {BrackGraph}+ {Operator GraphExpr})


Operator = FunctionName // see A.7
    | ConstructorName // see A.7

FunctionName = LowerCaseId | UpperCaseId | FunnyId
ConstructorName = UpperCaseId | FunnyId

BrackGraph = GraphVariable
    | Constructor

GraphVariable = Variable
Variable = LowerCaseId

My questions are:

1. in the Operator rule, FunctionName and ConstructorName are overlapping, for example FunnyId could be parsed as both FunctionName and ConstructorName.

2. first of BrackGraph and Operator could be the same kind of token, for example LowerCaseId.

Any idears?

Thanks a lot.

Jigang

 





More information about the clean-list mailing list