⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sor.c

📁 SRI international 发布的OAA框架软件
💻 C
📖 第 1 页 / 共 4 页
字号:
    zzBLOCK(zztasp2);
    zzMake0;
    {
    if ( (LA(1)==84)
 ) {
      zzmatch(84); 
      if (!trouble) (*_root)->no_copy=no_copy=1;
 zzCONSUME;

    }
    else {
      if ( (setwd2[LA(1)]&0x4) ) {
      }
      else {zzFAIL(1,zzerr4,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
    }
    zzEXIT(zztasp2);
    }
  }
  {
    zzBLOCK(zztasp2);
    zzMake0;
    {
    if ( (setwd2[LA(1)]&0x8) ) {
      {
        zzBLOCK(zztasp3);
        zzMake0;
        {
        if ( (LA(1)==85) ) {
          zzmatch(85);  zzCONSUME;
        }
        else {
          if ( (LA(1)==PassAction) ) {
          }
          else {zzFAIL(1,zzerr5,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
        }
        zzEXIT(zztasp3);
        }
      }
      zzmatch(PassAction); 
      if (!trouble) p->args = actiondup(LATEXT(1));
 zzCONSUME;

    }
    else {
      if ( (setwd2[LA(1)]&0x10)
 ) {
      }
      else {zzFAIL(1,zzerr6,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
    }
    zzEXIT(zztasp2);
    }
  }
  {
    zzBLOCK(zztasp2);
    zzMake0;
    {
    if ( (LA(1)==86) ) {
      zzmatch(86);  zzCONSUME;
      zzmatch(PassAction); 
      if (!trouble) p->rt = actiondup(LATEXT(1));
 zzCONSUME;

    }
    else {
      if ( (LA(1)==LABEL) ) {
      }
      else {zzFAIL(1,zzerr7,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
    }
    zzEXIT(zztasp2);
    }
  }
  zzmatch(LABEL);  zzCONSUME;
  block(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail);
  zzmatch(87); 
  
  if ( !trouble ) (*_root)->refvars = RefVars;
  RefVars=NULL;
 zzCONSUME;

  
  if ( trouble ) (*_root) = NULL;
  CurRule = NULL;
  zzEXIT(zztasp1);
  return;
fail:
  zzEXIT(zztasp1);
  found_error=1;  
  zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
  zzresynch(setwd2, 0x20);
  }
}

void
#ifdef __USE_PROTOS
block(AST**_root,int no_copy)
#else
block(_root,no_copy)
AST **_root;
 int no_copy ;
#endif
{
  zzRULE;
  zzBLOCK(zztasp1);
  zzMake0;
  {
  int line=zzline, file=CurFile;
  alt(zzSTR,  no_copy ); zzlink(_root, &_sibling, &_tail);
  {
    zzBLOCK(zztasp2);
    zzMake0;
    {
    while ( (LA(1)==88) ) {
      zzmatch(88);  zzCONSUME;
      alt(zzSTR,  no_copy ); zzlink(_root, &_sibling, &_tail);
      zzLOOP(zztasp2);
    }
    zzEXIT(zztasp2);
    }
  }
  
  (*_root) = zztmake( zzmk_ast(zzastnew(),BLOCK), (*_root) , NULL);
  (*_root)->file = file;
  (*_root)->line = line;
  zzEXIT(zztasp1);
  return;
fail:
  zzEXIT(zztasp1);
  found_error=1;  
  zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
  zzresynch(setwd2, 0x40);
  }
}

void
#ifdef __USE_PROTOS
alt(AST**_root,int no_copy)
#else
alt(_root,no_copy)
AST **_root;
 int no_copy ;
#endif
{
  zzRULE;
  zzBLOCK(zztasp1);
  zzMake0;
  {
  int line=zzline, file=CurFile; int local_no_copy=0;
  {
    zzBLOCK(zztasp2);
    zzMake0;
    {
    if ( (LA(1)==84) ) {
      zzmatch(84); 
      local_no_copy=1;
 zzCONSUME;

    }
    else {
      if ( (setwd2[LA(1)]&0x80)
 ) {
      }
      else {zzFAIL(1,zzerr8,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
    }
    zzEXIT(zztasp2);
    }
  }
  {
    zzBLOCK(zztasp2);
    zzMake0;
    {
    if ( (setwd3[LA(1)]&0x1) ) {
      {
        zzBLOCK(zztasp3);
        int zzcnt=1;
        zzMake0;
        {
        do {
          if ( (setwd3[LA(1)]&0x2) && (LA(2)==LABEL) ) {
            labeled_element(zzSTR,  no_copy||local_no_copy ); zzlink(_root, &_sibling, &_tail);
          }
          else {
            if ( (setwd3[LA(1)]&0x4) && (setwd3[LA(2)]&0x8) ) {
              element(zzSTR,  no_copy||local_no_copy ); zzlink(_root, &_sibling, &_tail);
            }
            else {
              if ( (LA(1)==BT) ) {
                tree(zzSTR,  no_copy||local_no_copy ); zzlink(_root, &_sibling, &_tail);
              }
              /* MR10 ()+ */ else {
                if ( zzcnt > 1 ) break;
                else {zzFAIL(2,zzerr9,zzerr10,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
              }
            }
          }
          zzcnt++; zzLOOP(zztasp3);
        } while ( 1 );
        zzEXIT(zztasp3);
        }
      }
    }
    else {
      if ( (setwd3[LA(1)]&0x10)
 ) {
      }
      else {zzFAIL(1,zzerr11,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
    }
    zzEXIT(zztasp2);
    }
  }
  
  (*_root) = zztmake( zzmk_ast(zzastnew(),ALT), (*_root) , NULL);
  (*_root)->file = file;
  (*_root)->line = line;
  zzEXIT(zztasp1);
  return;
fail:
  zzEXIT(zztasp1);
  found_error=1;  
  zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
  zzresynch(setwd3, 0x20);
  }
}

void
#ifdef __USE_PROTOS
element(AST**_root,int no_copy)
#else
element(_root,no_copy)
AST **_root;
 int no_copy ;
#endif
{
  zzRULE;
  zzBLOCK(zztasp1);
  zzMake0;
  {
  /**** SymEntry *p; **** MR10 ****/ int file,line; int local_no_copy=0;
  if ( (LA(1)==Token) ) {
    token(zzSTR,  no_copy ); zzlink(_root, &_sibling, &_tail);
  }
  else {
    if ( (LA(1)==NonTerm) ) {
      file = CurFile; line=zzline;
      zzmatch(NonTerm); zzsubroot(_root, &_sibling, &_tail); zzCONSUME;
      {
        zzBLOCK(zztasp2);
        zzMake0;
        {
        if ( (LA(1)==84) ) {
          zzmatch(84); 
          local_no_copy = 1;
 zzCONSUME;

        }
        else {
          if ( (setwd3[LA(1)]&0x40) ) {
          }
          else {zzFAIL(1,zzerr12,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
        }
        zzEXIT(zztasp2);
        }
      }
      {
        zzBLOCK(zztasp2);
        zzMake0;
        {
        if ( (setwd3[LA(1)]&0x80)
 ) {
          {
            zzBLOCK(zztasp3);
            zzMake0;
            {
            if ( (LA(1)==85) ) {
              zzmatch(85);  zzCONSUME;
            }
            else {
              if ( (LA(1)==PassAction) ) {
              }
              else {zzFAIL(1,zzerr13,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
            }
            zzEXIT(zztasp3);
            }
          }
          zzmatch(PassAction); zzsubchild(_root, &_sibling, &_tail);
          (*_root)->in = 1;
 zzCONSUME;

        }
        else {
          if ( (setwd4[LA(1)]&0x1) ) {
          }
          else {zzFAIL(1,zzerr14,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
        }
        zzEXIT(zztasp2);
        }
      }
      {
        zzBLOCK(zztasp2);
        zzMake0;
        {
        if ( (LA(1)==86) ) {
          zzmatch(86);  zzCONSUME;
          zzmatch(PassAction); zzsubchild(_root, &_sibling, &_tail);
          (*_root)->out = 1;
 zzCONSUME;

        }
        else {
          if ( (setwd4[LA(1)]&0x2)
 ) {
          }
          else {zzFAIL(1,zzerr15,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
        }
        zzEXIT(zztasp2);
        }
      }
      (*_root)->file = file; (*_root)->line=line;
      (*_root)->no_copy =  no_copy || local_no_copy;
    }
    else {
      if ( (LA(1)==Action) ) {
        file = CurFile; line=zzline;
        zzmatch(Action); zzsubchild(_root, &_sibling, &_tail);
        zzastArg(1)->action = actiondup(LATEXT(1));
 zzCONSUME;

        {
          zzBLOCK(zztasp2);
          zzMake0;
          {
          if ( (LA(1)==PRED_OP) ) {
            zzmatch(PRED_OP); zzsubroot(_root, &_sibling, &_tail); zzCONSUME;
          }
          else {
            if ( (setwd4[LA(1)]&0x4) ) {
            }
            else {zzFAIL(1,zzerr16,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
          }
          zzEXIT(zztasp2);
          }
        }
        (*_root)->file = file; (*_root)->line=line;
      }
      else {
        if ( (LA(1)==89) ) {
          file = CurFile; line=zzline;
          zzmatch(89);  zzCONSUME;
          block(zzSTR,  no_copy ); zzlink(_root, &_sibling, &_tail);
          zzmatch(90);  zzCONSUME;
          {
            zzBLOCK(zztasp2);
            zzMake0;
            {
            if ( (LA(1)==CLOSURE)
 ) {
              zzmatch(CLOSURE); zzsubroot(_root, &_sibling, &_tail); zzCONSUME;
            }
            else {
              if ( (LA(1)==POS_CLOSURE) ) {
                zzmatch(POS_CLOSURE); zzsubroot(_root, &_sibling, &_tail); zzCONSUME;
              }
              else {
                if ( (LA(1)==PRED_OP) ) {
                  zzmatch(PRED_OP); zzsubroot(_root, &_sibling, &_tail);
                  found_guess_block=1;
 zzCONSUME;

                }
                else {
                  if ( (setwd4[LA(1)]&0x8) ) {
                  }
                  else {zzFAIL(1,zzerr17,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
                }
              }
            }
            zzEXIT(zztasp2);
            }
          }
          (*_root)->file = file; (*_root)->line=line;
        }
        else {
          if ( (LA(1)==OPT) ) {
            zzmatch(OPT); zzsubroot(_root, &_sibling, &_tail); zzCONSUME;
            block(zzSTR,  no_copy ); zzlink(_root, &_sibling, &_tail);
            zzmatch(80);  zzCONSUME;
          }
          else {
            if ( (LA(1)==WILD)
 ) {
              file = CurFile; line=zzline;
              zzmatch(WILD); zzsubchild(_root, &_sibling, &_tail); zzCONSUME;
              {
                zzBLOCK(zztasp2);
                zzMake0;
                {
                if ( (LA(1)==84) ) {
                  zzmatch(84); 
                  local_no_copy = 1;
 zzCONSUME;

                }
                else {
                  if ( (setwd4[LA(1)]&0x10) ) {
                  }
                  else {zzFAIL(1,zzerr18,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
                }
                zzEXIT(zztasp2);
                }
              }
              (*_root)->no_copy =  no_copy || local_no_copy;
              (*_root)->file = file; (*_root)->line=line;
            }
            else {zzFAIL(1,zzerr19,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
          }
        }
      }
    }
  }
  zzEXIT(zztasp1);
  return;
fail:
  zzEXIT(zztasp1);
  found_error=1;  
  zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
  zzresynch(setwd4, 0x20);
  }
}

void
#ifdef __USE_PROTOS
labeled_element(AST**_root,int no_copy)
#else
labeled_element(_root,no_copy)
AST **_root;
 int no_copy ;
#endif
{
  zzRULE;
  zzBLOCK(zztasp1);
  zzMake0;
  {
  Attrib label; int file,line; SymEntry *s; int local_no_copy=0;
  {
    zzBLOCK(zztasp2);
    zzMake0;
    {
    if ( (LA(1)==Token) ) {
      zzmatch(Token); 
      label = zzaArg(zztasp2,1);
 zzCONSUME;

    }
    else {
      if ( (LA(1)==NonTerm) ) {
        zzmatch(NonTerm); 
        label = zzaArg(zztasp2,1);
 zzCONSUME;

      }
      else {zzFAIL(1,zzerr20,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
    }
    zzEXIT(zztasp2);
    }
  }
  
  s = (SymEntry *) hash_get(symbols, label.text);
  if ( s==NULL ) {
    s = (SymEntry *) hash_add(symbols, label.text, (Entry *) newSymEntry(label.text));
    s->token = LABEL;
  }
  else if ( s->token!=LABEL ) {
    err(eMsg2("label definition clashes with %s definition: '%s'", zztokens[s->token], label.text));
  }
  zzmatch(LABEL);  zzCONSUME;
  {
    zzBLOCK(zztasp2);
    zzMake0;
    {
    file = CurFile; line=zzline;
    if ( (LA(1)==Token)
 ) {
      token(zzSTR,  no_copy ); zzlink(_root, &_sibling, &_tail);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -