javacc笔记2

void basic_expr() :
	{}
	{
	  <ID> "(" expr() ")"	// Choice 1
	|
	  "(" expr() ")"	// Choice 2
	|
	  "new" <ID>		// Choice 3
	}

The choice determination algorithm works as follows:


	if (next token is <ID>) {
	  choose Choice 1
	} else if (next token is "(") {
	  choose Choice 2
	} else if (next token is "new") {
	  choose Choice 3
	} else {
	  produce an error message
	}

你可能感兴趣的:(javacc笔记2)