亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? typechecker.java

?? java實現的一個pascal編譯器
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
    }
  }       

  /**
   * constant =
   *   ......... |
   *   {string} string ;
   *   ......... ;
   * sets type to char or string.
   */
  public void outAStringConstant(AStringConstant node) {
    TCharacterLiteral char_lit = node.getCharacterLiteral();
    String image = char_lit.getText();
   
    if (image.length() <= 3) {
      type = CHAR;
    }   
    else {
      type = STRING;
    }
  }

  /**
   * var_decl =
   *   identifier_list colon P.type semicolon ;
   *  empties idlist if it has some elements
   */
  public void inAVarDecl(AVarDecl node) {
    if (!idlist.isEmpty()) {
      idlist.removeAllElements();
    }
  }

  /**
   * puts all the identifiers in idlist in the 
   * corresponding symbol table
   */
  public void outAVarDecl(AVarDecl node) {
    TIdentifier ident;
    String key;
    for (Enumeration e = idlist.elements(); e.hasMoreElements(); ) {
      ident = (TIdentifier) e.nextElement();
      key = ident.getText().toUpperCase();
      if (program) {
        global_table.put(key, new Variable(type));
      }
      else if (monitor) {
        monitor_table.put(key, new Variable(type));
      }
      else {
        local_table.put(key, new Variable(type));
      }
    }
  }

  /**
   * adds the identifier list to the corresponding symbol table.
   *
  /**
   * identifier_list =
   *   {single} identifier |
   *   .......... ;
   * puts the identifier in the idlist
   */
  public void outASingleIdentifierList(ASingleIdentifierList node) {
    idlist.addElement(node.getIdentifier());
  }

  /**
   * identifier_list =
   *   ............. |
   *   {sequence} identifier_list comma identifier ;
   *
   * @see TypeChecker.outASingleIdentifierList
   */
  public void outASequenceIdentifierList(ASequenceIdentifierList node) {
    idlist.addElement(node.getIdentifier());
  }

  /**
   * procedure_heading =
   *   {simple} identifier |
   *   ............. ;
   * puts the procedure identifier in the corresponding table.
   */
  public void outASimpleProcedureHeading(ASimpleProcedureHeading node) {
    TIdentifier ident = node.getIdentifier();
    String key = ident.getText().toUpperCase();
    
    if (program) {
      global_table.put(key, new Procedure(false, false));
      program = false;
      previous_entity = PROGRAM;
    }
    else if (monitor) {
      if (private_modifier) {
        monitor_table.put(key, new Procedure(false, true));
        private_modifier = false;
      }
      else {
        monitor_table.put(key, new Procedure(false, false));
      }
      monitor = false;
      previous_entity = MONITOR;
    }
    if (!local_table.isEmpty()) {
      local_table.clear();
    }
  }

  /**
   * removes all elements in the idlist 
   */
  public void inASimpleThrowsProcedureHeading(ASimpleThrowsProcedureHeading node) {
    if (!idlist.isEmpty()) {
      idlist.removeAllElements();
    }
  }

  /** 
   * procedure_heading =
   *   ............ |
   *   {simple_throws} procedure identifier semicolon throws 
   *     identifier_list semicolon |
   *   .............. ;
   */
  public void outASimpleThrowsProcedureHeading(ASimpleThrowsProcedureHeading node) {
    TIdentifier ident = node.getIdentifier();
    String key = ident.getText().toUpperCase();

    if (program) {
      global_table.put(key, new Procedure(true, false));
      program = false;
      previous_entity = PROGRAM;
    }
    else if (monitor) {
      if (private_modifier) {
        monitor_table.put(key, new Procedure(true, true));
        private_modifier = false;
      }
      else {
        monitor_table.put(key, new Procedure(true, false));
      }
      monitor = false;
      previous_entity = MONITOR;
    }
    if (!throws_list.isEmpty()) {
      throws_list.clear();
    }
    for (Enumeration e = idlist.elements(); e.hasMoreElements();) {
      TIdentifier ident1 = (TIdentifier) e.nextElement();
      String key1 = ident1.getText().toUpperCase();

      if (!global_table.containsKey(key1) &&
          !(global_table.get(key) instanceof Variable) &&
          (( (Variable) global_table.get(key1) ).getType() != EXCEPTION)) {
        err.report(8, ident1.getLine(), ident1.getPos());
      }
      throws_list.put(key1, key1);
    }
    if (!local_table.isEmpty()) {
      local_table.clear();
    }
  }

  /**
   * creates a new instance of class Vector
   * if it is not empty
   */
  public void inAArgumentsProcedureHeading(AArgumentsProcedureHeading node) {
    arguments = new Vector();
    if (!local_table.isEmpty()) {
      local_table.clear();
    }
    arguments = new Vector();
  }

  /**
   * procedure_heading =
   *   ........... |
   *   {arguments} procedure identifier l_paren identifier_list r_paren
   *       semicolon |
   *    ............ ;
   * @see TypeChecker.outASimpleProcedureHeading
   */
  public void outAArgumentsProcedureHeading(AArgumentsProcedureHeading node) {
    TIdentifier ident = node.getIdentifier();
    String key = ident.getText().toUpperCase();

    if (program) {
      global_table.put(key, new Procedure((Vector)arguments.clone(), false, false));
      program = false;
      previous_entity = PROGRAM;
    }
    else if (monitor) {
      if (private_modifier) {
        monitor_table.put(key, new Procedure((Vector)arguments.clone(), false,true));
        private_modifier = false;
      }
      else {
        monitor_table.put(key, new Procedure((Vector)arguments.clone(), false, false));
      }
      monitor = false;
      previous_entity = MONITOR;
    }
  }

  /**
   * procedure_heading =
   *   ............. |
   *   {arguments_throws} procedure identifier l_paren parameter_list 
   *      r_paren semicolon throws identifier_list semicolon ;
   *
   * @see TypeChecker.outAArgumentsProcedureHeading
   */
  public void caseAArgumentsThrowsProcedureHeading(
          AArgumentsThrowsProcedureHeading node) {
    TIdentifier ident = node.getIdentifier();
    String key = ident.getText().toUpperCase();

    if (!arguments.isEmpty()) {
      arguments.removeAllElements();
    }
    if (node.getParameterList() != null) {
      node.getParameterList().apply(this);
    }

    if (!idlist.isEmpty()) {
      idlist.removeAllElements();
    }

    if (node.getIdentifierList() != null) {
      node.getIdentifierList().apply(this);
    }

    if (!throws_list.isEmpty()) {
      throws_list.clear();
    }

    for (Enumeration e = idlist.elements(); e.hasMoreElements();) {
      TIdentifier ident1 = (TIdentifier) e.nextElement();
      String key1 = ident1.getText().toUpperCase();

      if (!global_table.containsKey(key1) ||
          !(global_table.get(key1) instanceof Variable) ||
          (( (Variable) global_table.get(key1) ).getType() != EXCEPTION)) {
        err.report(8, ident.getLine(), ident.getPos());
      }
      throws_list.put(key1, key1);
    }
     
    if (program) {
      global_table.put(key, new Procedure((Vector) arguments.clone(), true, false));
      program = false;
      previous_entity = PROGRAM;
    } 
    else if (monitor) {
      if (private_modifier) {
        monitor_table.put(key, new Procedure((Vector)arguments.clone(), true, true));
        private_modifier = false;
      }
      else {
        monitor_table.put(key, new Procedure((Vector) arguments.clone(), true, false));
      }
      monitor = false;
      previous_entity = MONITOR;
    }   
  }    

  /**
   * removes all elements in idlist
   */
  public void inAFormalParameter(AFormalParameter node) {
    if(!idlist.isEmpty()) {
      idlist.removeAllElements();
    }
  }

  /**
   * formal_parameter = 
   *   identifier_list colon P.type ;
   *
   * adds to local table all the elements in the list with type, and 
   * adds the number of identifiers times type to the arguments list.
   */
  public void outAFormalParameter(AFormalParameter node) {
    String key;

    for (Enumeration e = idlist.elements(); e.hasMoreElements(); ) {
      key = ((TIdentifier) e.nextElement()).getText().toUpperCase();
      arguments.addElement(type);
      local_table.put(key, new Variable(type));
    }
  }

  /**
   * function_heading =
   *   {simple} function identifier colon P.type semicolon |
   * adds a new function to global_table.
   */
  public void outASimpleFunctionHeading(ASimpleFunctionHeading node) {
    String key = node.getIdentifier().getText().toUpperCase();
    current_function = node.getIdentifier().getText();
    global_table.put(key, new Function(false, type));
    function = true;
    program = false;
  }

  /**
   * clears the identifier list
   */
  public void inASimpleThrowsFunctionHeading(ASimpleThrowsFunctionHeading node) {
    if (!idlist.isEmpty()) {
      idlist.removeAllElements();
    }
  }

  /**
   * adds a new function to global table
   */
  public void outASimpleThrowsFunctionHeading(ASimpleThrowsFunctionHeading node) {
    TIdentifier ident = node.getIdentifier();
    String key = ident.getText().toUpperCase();
    current_function = ident.getText();

    for (Enumeration e = idlist.elements(); e.hasMoreElements();) {
      TIdentifier ident1 = (TIdentifier) e.nextElement();
      String key1 = ident1.getText().toUpperCase();

      if (!global_table.containsKey(key1) ||
          !(global_table.get(key1) instanceof Variable) ||
          (((Variable) global_table.get(key1)).getType() != EXCEPTION)) {
        err.report(8, ident1.getLine(), ident1.getPos());
      }
      throws_list.put(key1, key1);
    }
    global_table.put(key, new Function(true, type));
    function = true;
    program = false;
  }

  /**
   * clears the arguments Vector
   */
  public void inAArgumentsThrowsFunctionHeading(AArgumentsThrowsFunctionHeading node) {
    if (!arguments.isEmpty()) {
      arguments.removeAllElements();
    }
  }

  /**
   * adds a new function to the global table
   */
  public void outAArgumentsFunctionHeading(AArgumentsFunctionHeading node) {
    String key = node.getIdentifier().getText().toUpperCase();
    current_function = node.getIdentifier().getText().toUpperCase();

    global_table.put(key, new Function((Vector) arguments.clone(), false, type));
    program = false;
    function = true;
  }

  /**
   * @see TypeChecker.outAArgumentsFunctionHeading
   */
  public void caseAArgumentsThrowsFunctionHeading(
                  AArgumentsThrowsFunctionHeading node) {
    String key = node.getIdentifier().getText().toUpperCase();
    current_function = node.getIdentifier().getText();

    if (!local_table.isEmpty()) {
      local_table.clear();
    }
    if (!arguments.isEmpty()) {
      arguments.removeAllElements();
    }
    if (node.getParameterList() != null) {
      node.getParameterList().apply(this);
    }
    
    if (node.getType() != null) {
      node.getType().apply(this);
    }

    if (!idlist.isEmpty()) {
      idlist.removeAllElements(); 
    }
    if (node.getIdentifierList() != null) {
      node.getIdentifierList().apply(this);
    }

    if (!throws_list.isEmpty()) {
      throws_list.clear();
    }

    for (Enumeration e = idlist.elements(); e.hasMoreElements();) {
      TIdentifier ident1 = (TIdentifier) e.nextElement();
      String key1 = ident1.getText().toUpperCase();

      if (!global_table.containsKey(key1) ||
          !(global_table.get(key1) instanceof Variable) ||
          (((Variable) global_table.get(key1)).getType() != EXCEPTION)) {
        err.report(8, ident1.getLine(), ident1.getPos());
      }
      throws_list.put(key1, key1);
    }
    global_table.put(key, new Function((Vector) arguments.clone(), true, type));
    program = false;
    function = true;
  }           

  /**
   * sets program to if previous_entity is equal to PROGRAM
   * , else sets monitor to true;
   */
  public void outAProcedureDeclaration(AProcedureDeclaration node) {
    if (previous_entity == PROGRAM) {
      program = true;
    }
    else {
      monitor = true;
    }
  }

  /**
   * sets program to true
   */
  public void outAFunctionDeclaration(AFunctionDeclaration node) {
    program = true;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产河南妇女毛片精品久久久 | 国产香蕉久久精品综合网| 日韩av一区二区三区四区| 欧美成va人片在线观看| 成人一区在线观看| 亚洲综合色噜噜狠狠| 中文字幕精品一区二区三区精品| 欧美在线观看一二区| 国产一区二区三区不卡在线观看| 最新不卡av在线| 精品成人佐山爱一区二区| 在线精品视频一区二区三四| 国产成人综合在线观看| 日日骚欧美日韩| 亚洲美女视频在线观看| 精品国产污污免费网站入口 | 成人av在线一区二区三区| 午夜激情综合网| 亚洲欧美日韩小说| 久久精品在线免费观看| 精品久久久久av影院| 欧美一卡二卡在线| 欧美日韩和欧美的一区二区| 色婷婷综合在线| av成人免费在线| 国产99久久久国产精品| 一卡二卡三卡日韩欧美| 亚洲日本韩国一区| 亚洲私人黄色宅男| 亚洲手机成人高清视频| 国产精品每日更新在线播放网址| 欧美精品一区二| 久久精品亚洲精品国产欧美kt∨| 精品日韩在线观看| 亚洲精品一区二区三区在线观看| 日韩欧美黄色影院| 精品久久久久久久久久久久久久久| 日韩一区二区三区高清免费看看| 欧美日韩亚洲综合一区二区三区 | 国产精品一区二区在线观看不卡 | 欧美在线你懂的| 日韩一区二区麻豆国产| 2020国产成人综合网| 亚洲国产电影在线观看| 亚洲国产一区二区三区| 日韩一区精品视频| 成人小视频在线| 欧美自拍偷拍一区| 精品视频在线看| 精品国产乱码久久久久久影片| 欧美一区二区精美| 久久久午夜精品理论片中文字幕| 亚洲乱码国产乱码精品精的特点 | 亚洲欧美日韩一区二区三区在线观看| 国产精品伦理在线| 午夜成人免费视频| www.日本不卡| 欧美一区二区视频免费观看| 中文字幕免费一区| 国产女主播一区| 视频在线观看一区| 91福利在线免费观看| 日韩三级中文字幕| 自拍偷拍亚洲综合| 国产九色sp调教91| 欧美一区二区免费观在线| 久久久久久久久免费| 午夜一区二区三区视频| 国产69精品久久久久777| 欧美一卡在线观看| 亚欧色一区w666天堂| 国产成人av电影在线播放| 欧美电影免费观看高清完整版在线观看 | 国产综合色产在线精品| 欧美三级电影在线观看| 精品剧情在线观看| 日韩高清在线一区| 欧美日本在线看| 日韩精品一二三| 精品免费日韩av| 成人一二三区视频| 国产精品麻豆欧美日韩ww| 麻豆专区一区二区三区四区五区| 欧美高清www午色夜在线视频| 婷婷综合久久一区二区三区| 欧美日韩美少妇| 日本麻豆一区二区三区视频| 在线91免费看| 国产91色综合久久免费分享| 亚洲日本免费电影| 制服丝袜日韩国产| 国产精品中文欧美| 一区2区3区在线看| 欧美mv和日韩mv的网站| 成人黄色软件下载| 午夜影院久久久| 国产精品对白交换视频 | 久久国产综合精品| 亚洲欧美怡红院| av在线播放成人| 日本美女视频一区二区| 欧美三级日韩三级国产三级| 精品一区二区三区香蕉蜜桃| 欧美激情资源网| av成人免费在线观看| 亚洲一区二区三区四区在线| 51久久夜色精品国产麻豆| 91亚洲国产成人精品一区二三| 日韩不卡一二三区| 久久久.com| 国产亚洲一区二区在线观看| 欧美老女人第四色| 91国偷自产一区二区开放时间| 国产一区二区三区在线观看免费| 亚洲综合男人的天堂| 亚洲美女视频在线| 久久精品人人做人人爽97| 日韩精品一区在线观看| 日韩一区和二区| 91精品国产麻豆| 日韩视频一区二区三区在线播放 | 亚洲欧美日韩国产另类专区| 久久久av毛片精品| 成人免费视频在线观看| 国产欧美日韩麻豆91| 中文字幕精品—区二区四季| 中文字幕日韩一区二区| 亚洲手机成人高清视频| 亚洲免费在线观看| 婷婷夜色潮精品综合在线| 丝袜美腿亚洲色图| 精品一区二区三区免费播放| 国内精品在线播放| 不卡的av网站| 成人动漫在线一区| 精品国产一区二区三区不卡 | 色哟哟欧美精品| 欧美系列日韩一区| 日韩欧美黄色影院| 国产精品你懂的在线欣赏| 国产亚洲视频系列| 五月天激情综合| 成人国产电影网| 日韩一区二区在线观看视频| 欧美国产日韩在线观看| 亚洲第一久久影院| 国产一级精品在线| 4438成人网| 亚洲国产日韩一级| 国产91丝袜在线18| 日韩精品中午字幕| 天天影视涩香欲综合网| 91丨九色丨蝌蚪富婆spa| 久久亚区不卡日本| 美女脱光内衣内裤视频久久网站 | 亚洲色图都市小说| 91香蕉视频mp4| 国产精品进线69影院| 经典三级视频一区| 欧美v国产在线一区二区三区| 香蕉久久一区二区不卡无毒影院| 美女视频黄频大全不卡视频在线播放| 91在线视频在线| 中文字幕在线一区免费| 成人免费视频免费观看| 91精品国产一区二区三区蜜臀| 午夜视频在线观看一区| 91精品在线观看入口| 午夜视频在线观看一区| 国产日产欧美一区| 欧美三级电影在线看| 国产福利一区二区三区| 亚洲成精国产精品女| 日韩限制级电影在线观看| 国产高清精品久久久久| 日韩国产在线观看一区| 国产精品久久久久久久久久久免费看 | 国模大尺度一区二区三区| 亚洲视频综合在线| 精品美女在线观看| 色女孩综合影院| 成人自拍视频在线| 久久国产精品99精品国产 | 中文字幕欧美三区| 久久综合一区二区| 91精品国产综合久久婷婷香蕉| 99久久777色| 91尤物视频在线观看| 国产一区二区三区免费看| 麻豆91在线看| 久久99国产精品久久99 | 视频一区在线视频| 亚洲日本va在线观看| 欧美高清在线一区二区| 日韩精品一区二区三区在线播放| 欧美另类videos死尸| 精品1区2区3区| 日韩欧美视频一区| 精品国产网站在线观看| 久久一区二区三区国产精品|