Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Chapter 11. Rules

A rule is a named collection of alternative productions. There are three kinds of rules: syntax, token, and interleave. A text value conforms to a rule if it conforms to any one of the productions in the rule. If a text value conforms to more than one production in the rule, then the rule is ambiguous. The three different kinds of rules differ in how they treat ambiguity and how they handle their output.

RuleDeclaration:
					Attributesopt MemberModifiersopt Kind Name RuleParametersopt RuleBodyopt ;
Kind:
					token
					syntax
					interleave
					MemberModifiers:
					MemberModifier
					MemberModifiers MemberModifer
					MemberModifier:
					final
					identifier
					RuleBody:
  = ProductionDeclarations
					ProductionDeclarations:
					ProductionDeclaration
					ProductionDeclarations | ProductionDeclaration

					  


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint