示例#1
0
static void
Classification (void)
{
  lsymbol ntext = ltoken_getRawText (nextToken);  
    
  if (ntext == ltoken_getText (endCommentCharToken)
      || ntext == ltoken_getText (idCharToken)
      || ntext == ltoken_getText (opCharToken)
      || ntext == ltoken_getText (extensionCharToken)
      || ntext == ltoken_getText (singleCharToken)
      || ntext == ltoken_getText (whiteCharToken))
    {
      CharClass ();
      InitReduce (CLASSIFICATION1);
    }
  else if (ntext == ltoken_getText (quantifierSymToken)
	   || ntext == ltoken_getText (logicalOpToken)
	   || ntext == ltoken_getText (eqOpToken)
	   || ntext == ltoken_getText (equationSymToken)
	   || ntext == ltoken_getText (eqSepSymToken)
	   || ntext == ltoken_getText (selectSymToken)
	   || ntext == ltoken_getText (openSymToken)
	   || ntext == ltoken_getText (sepSymToken)
	   || ntext == ltoken_getText (closeSymToken)
	   || ntext == ltoken_getText (simpleIdToken)
	   || ntext == ltoken_getText (mapSymToken)
	   || ntext == ltoken_getText (markerSymToken)
	   || ntext == ltoken_getText (commentSymToken))
    {
      TokenClass ();
      InitReduce (CLASSIFICATION2);
    }
  else if (ntext == ltoken_getText (synonymToken))
    {
      SynClass ();
      InitReduce (CLASSIFICATION3);
    }
  else
    {
      llbug (message ("Expected character, token, or synonym classification: %s",
		      ltoken_getRawString (nextToken)));
      /* pop off all tokens on this line */
    }
}
示例#2
0
static void
Classification (void)
{
  if (ltoken_getRawText (nextToken) == ltoken_getText (endCommentCharToken)
      || ltoken_getRawText (nextToken) == ltoken_getText (idCharToken)
      || ltoken_getRawText (nextToken) == ltoken_getText (opCharToken)
      || ltoken_getRawText (nextToken) == ltoken_getText (extensionCharToken)
      || ltoken_getRawText (nextToken) == ltoken_getText (singleCharToken)
      || ltoken_getRawText (nextToken) == ltoken_getText (whiteCharToken))
    {
      CharClass ();
      InitReduce (CLASSIFICATION1);
    }
  else if (ltoken_getRawText (nextToken) == ltoken_getText (quantifierSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (logicalOpToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (eqOpToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (equationSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (eqSepSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (selectSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (openSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (sepSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (closeSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (simpleIdToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (mapSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (markerSymToken)
	   || ltoken_getRawText (nextToken) == ltoken_getText (commentSymToken))
    {
      TokenClass ();
      InitReduce (CLASSIFICATION2);
    }
  else if (ltoken_getRawText (nextToken) == ltoken_getText (synonymToken))
    {
      SynClass ();
      InitReduce (CLASSIFICATION3);
    }
  else
    {
      LocalUserError (nextToken,
		      "expected character, token, or synonym classification");
    }
}
示例#3
0
 CharClass CreateClass(CharClassBits classBits) const
 {
     return CharClass(*this, classBits);
 }