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

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

?? preprocessor.java

?? 外國人寫的c#語法解析器
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:

  /**
   * Reads the next input line and advances the internal line counter. If we are currently in multi
   * line comment mode then skip comment lines until we find a comment end.
   * 
   * @return The read line.
   * @throws IOException
   */
  protected String readLine() throws IOException
  {
    String line = null;
    
    do
    {
      line = input.readLine();
      if (traceProcessing)
        System.out.println("   : " + line);
      if (line == null)
      {
        // If the input string empty then there is no more input available in this file.
        // Return to previous input state in this case.
        reportIncludeFile("<<< " + inputState.getFilename());
        inputState.popState();
        break;
      }
      if (skip != SKIP_NONE)
        break;
      
      // First check if we are still waiting for a multi line comment to end.
      if (inMultilineComment)
      {
        int commentEndIndex = line.indexOf("*/");
        // If the comment does not end on this line then start over with the next one.
        if (commentEndIndex == -1)
          continue;
        
        // The multi line comment ends here. Remove the remaining comment part and continue processing.
        inMultilineComment = false;
        line = line.substring(commentEndIndex + 2, line.length());
        break;
      }
    }
    while (inMultilineComment);
    
    if (line == null)
      return null;
    else
      if (skip != SKIP_NONE)
        return line.trim();
      else
        return removeComments(line);
  }

  //------------------------------------------------------------------------------------------------

  /**
   * Reads and processes all input until a non-preprocessor line is found. This line is appended
   * to the current content of the currentLine string buffer that is used to feed the lexer.
   * 
   * @throws IOException Thrown when something goes wrong with reading file data.
   */
  protected void readNextLine() throws IOException
  {
    currentLine.delete(0, currentPosition);
    currentPosition = 0;
    String result = processUnconditionalInput();
    if (result != null)
      currentLine.append(result);
    currentLine.append('\n');
  }

  //------------------------------------------------------------------------------------------------

  /**
   * Adds the given search path for include files to the internal list.
   * Note that this preprocessor does nothing know about predefined pathes as used in MSVC (e.g.
   * as in <tchar.h>). So you must explicitely give these pathes too.
   * 
   * @param name The new search path to add.
   */
  public void addIncludePath(String name)
  {
    includePaths.add(name); 
  }

  //------------------------------------------------------------------------------------------------

  /**
   * Adds the given macro to the internal macro table.
   * Note: The definition must not contain the <b>#define</b> part.
   * 
   * @param macro The macro definition string.
   */
  public void addMacro(String macro)
  {
    macroTable.defineMacro(macro);
  }
  
  //------------------------------------------------------------------------------------------------
  
  public void addPreprocessorEventListener(IParseEventListener listener)
  {
    listeners.add(listener);
  }

  //------------------------------------------------------------------------------------------------

  /* (non-Javadoc)
   * @see java.io.Reader#close()
   */
  public void close() throws IOException
  {
    // Nothing to do here.
  }

  //------------------------------------------------------------------------------------------------

  /**
   * Returns the internal table of collected macro definitions.
   * 
   * @return Returns the macro table.
   */
  public MacroTable getMacroTable()
  {
    return macroTable;
  }

  //------------------------------------------------------------------------------------------------

  public boolean hadErrors()
  {
    return hadErrors;
  }
  
  //------------------------------------------------------------------------------------------------

  public boolean hadWarnings()
  {
    return hadWarnings;
  }

  //------------------------------------------------------------------------------------------------

  /* (non-Javadoc)
   * @see net.softgems.resourceparser.main.IParseEventListener#handleEvent(int, java.lang.String)
   */
  public void handleEvent(int event, String message)
  {
    // This method is called here only during an expression evaluation and is used to forward
    // the incoming events to the owner of this preprocessor.
    doEvent(event, message, false);
  }
  
  //------------------------------------------------------------------------------------------------
  
  /**
   * Sets a new input state up so following read attempts by the lexer are directed to the new
   * preprocessor.
   * 
   * @param filename The file to include.
   * @return <b>true</b> if a new preprocessor was set up, otherwise <b>false</b>.
   * @throws IOException
   * @throws FileNotFoundException
   */
  public boolean includeFile(String filename) throws IOException, FileNotFoundException
  {
    boolean result = false;
    
    // The map processedIncludes contains files, which were marked with the "#pragma once" directive
    // and hence should automatically not be included more than once.
    if (!processedIncludes.containsKey(filename))
    {
      // To make relative includes from the included file possible switch to the resulting
      // directory of this include file. Restore the value after return.
      File canonicalFile = null;
  
      // Try to locate the include file without include path first (relative to application root)
      File file = new File(filename);

      // Convert eventual further subfolders in the file to one canonical file,
      // so we have resolved links and no special folders like "." or ".." etc. anymore.
      canonicalFile = file.getCanonicalFile();
      if (!file.isAbsolute())
      {
        // If the file is relative then first try to access it as if it is using the current
        // user dir as base folder.
        if (!canonicalFile.canRead())
        {
          // We have a relative file, which is not accessible from the current user directory.
          // Try each include path until we have access.
          for (Iterator iterator = includePaths.iterator(); iterator.hasNext();)
          {
            String path = (String) iterator.next();
            if (!path.endsWith(File.separator))
              path += File.separator;
            
            File testFile = new File(path + filename);
            if (testFile.exists())
            {
              canonicalFile = testFile.getCanonicalFile();
              break;
            }
          }
        }
      }
      
      if (canonicalFile.canRead())
      {
        reportIncludeFile(">>> " + filename);
        
        // If we can read the file then set up a new preprocessor instance. The sub preprocessor 
        // uses the same input state, include pathes and defined symbols as this one.
        InputConverter input = new InputConverter(inputState, new FileInputStream(canonicalFile), 
          DEFAULT_CHARSET);
        Preprocessor preprocessor = new Preprocessor(input, this, inputState, traceProcessing);
        inputState.pushState(preprocessor, canonicalFile.getName(), canonicalFile.getParent());
        preprocessor.addPreprocessorEventListener(
          new IParseEventListener() 
          {
            public void handleEvent(int event, String message)
            {
              doEvent(event, message, false);
            };
          }
        );
        preprocessor.init();
        result = true;
      }
      else
        reportWarning("Cannot access include file \"" + filename + "\"");
    }
    return result;
  }

  //------------------------------------------------------------------------------------------------

  public void init()
  {
    // Microsoft's resource compiler handles *.c and *.h files in a special way. Everything except 
    // preprocessor lines is automatically skipped in such files.
    // See also: "Using #include Directive with Windows Resource Compiler", KB Q80945.
    String filename = inputState.getFilename();
    skipNonPPLines = filename.toLowerCase().endsWith(".c") || filename.toLowerCase().endsWith(".h");
  }
  
  //------------------------------------------------------------------------------------------------

  /** 
   * This method is executed by the preprocessor internally when it detected an illegal
   *  state that cannot be recovered from.
   */
  public void panic(String s)
  {
    doEvent(IParseEventListener.PANIC, "RC lexer panic: " + s, true);
  }
  
  //------------------------------------------------------------------------------------------------

  /* (non-Javadoc)
   * @see java.io.Reader#read()
   */
  public int read() throws IOException
  {
    if (currentLine.length() < (currentPosition + 1))
      readNextLine();
    
    if (currentLine.length() == 0)
      return -1;
    else
      return currentLine.charAt(currentPosition++);
  }

  //------------------------------------------------------------------------------------------------

  /* (non-Javadoc)
   * @see java.io.Reader#read(char[], int, int)
   */
  public int read(char[] cbuf, int off, int len) throws IOException
  {
    if (currentLine.length() < (currentPosition + len))
      readNextLine();
    
    if (currentLine.length() == 0)
      return -1;
    else
    {
      int actualLength = Math.min(currentLine.length() - currentPosition, len);
      currentLine.getChars(currentPosition, actualLength, cbuf, off);
      currentPosition += actualLength;
      
      return actualLength;
    }
  }

  //------------------------------------------------------------------------------------------------

  /**
   * Removes the given listener from the internal list. If the listerner is not in this list
   * then the method does nothing.
   * 
   * @param listener The listener to be removed.
   */
  public void removePreprocessorEventListener(IParseEventListener listener)
  {
    listeners.remove(listener);
  }
  
  //------------------------------------------------------------------------------------------------

  /**
   * Removes the symbol with the given name from the internal symbol table. If the symbol does not
   * exist then nothing happens.
   * 
   * @param name The name of the symbol to be removed.
   */
  public void removeSymbol(String name)
  {
    macroTable.undefineMacro(name);
  }
  
  //------------------------------------------------------------------------------------------------
  
  /**
   * Reports an error to the calling application.
   * 
   * @param s Error message to report.
   */
  public void reportError(String s)
  {
    doEvent(IParseEventListener.ERROR, s, inputState.getFullFilename() != null);
  }

  //------------------------------------------------------------------------------------------------

  /**
   * Reports the names of all files, which are included during the preprocessing step.
   * 
   * @param filen The name of the file that is about to be processed.
   */
  public void reportIncludeFile(String file)
  {
    doEvent(IParseEventListener.INCLUDE_FILE, file, inputState.getFullFilename() != null);
  }

  //------------------------------------------------------------------------------------------------

  /**
   * Reports general information to the calling application.
   * 
   * @param s Information message to report.
   */
  public void reportInfo(String s)
  {
    doEvent(IParseEventListener.INFORMATION, s, inputState.getFullFilename() != null);
  }

  //------------------------------------------------------------------------------------------------
  
  /**
   * Reports a warning to the calling application.
   * 
   * @param s Warning message to report.
   */
  public void reportWarning(String s)
  {
    doEvent(IParseEventListener.WARNING, s, inputState.getFullFilename() != null);
  }

  //------------------------------------------------------------------------------------------------

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
2020国产精品自拍| 国产91精品久久久久久久网曝门| 国产精品麻豆网站| 欧美国产在线观看| 国产精品国产馆在线真实露脸 | 欧美老肥妇做.爰bbww视频| 91香蕉视频污在线| 在线这里只有精品| 在线亚洲一区观看| 欧美日韩免费观看一区三区| 91麻豆精品久久久久蜜臀| 91精品国产色综合久久| 日韩一区二区在线看片| 久久在线观看免费| 国产精品久线观看视频| 亚洲国产综合91精品麻豆| 日韩国产欧美在线播放| 奇米四色…亚洲| 成人在线视频一区| 色偷偷成人一区二区三区91| 欧美日韩高清一区二区不卡| 欧美精品一区二区三区四区| 国产精品伦理一区二区| 亚洲一区二区三区四区中文字幕| 日韩不卡一区二区| 大陆成人av片| 欧美电影在线免费观看| 国产亚洲精品bt天堂精选| 亚洲精品日韩一| 久久国产生活片100| 成人99免费视频| 欧美电影一区二区| 中文字幕av一区二区三区| 亚洲一二三四久久| 国产麻豆精品在线观看| 欧美自拍偷拍午夜视频| 久久综合成人精品亚洲另类欧美 | 国产成人综合网站| 欧美综合久久久| 国产午夜精品久久久久久免费视 | 欧美福利视频一区| 中文一区在线播放| 欧美aⅴ一区二区三区视频| www.色精品| 久久综合色综合88| 日韩中文字幕一区二区三区| av欧美精品.com| 久久午夜国产精品| 奇米色777欧美一区二区| 91最新地址在线播放| 欧美r级在线观看| 亚洲123区在线观看| 99精品欧美一区二区三区小说 | 天天爽夜夜爽夜夜爽精品视频| 国产精品18久久久久久vr| 欧美人狂配大交3d怪物一区| 国产精品久久久久久户外露出 | 国产精品福利av| 久久99精品国产麻豆不卡| 欧美三级视频在线| 亚洲欧美日韩中文字幕一区二区三区 | 免费观看在线综合色| av电影在线观看完整版一区二区| 日韩精品中文字幕在线不卡尤物| 伊人婷婷欧美激情| 91在线云播放| 亚洲日本在线a| a级精品国产片在线观看| 欧美高清一级片在线观看| 国产成人自拍在线| 国产亚洲成年网址在线观看| 精品制服美女久久| 欧美mv和日韩mv的网站| 奇米精品一区二区三区在线观看| 8v天堂国产在线一区二区| 亚洲国产美国国产综合一区二区| 欧美色成人综合| 日韩国产成人精品| 日韩一区二区视频| 韩国v欧美v亚洲v日本v| 久久精品一二三| 国产成人免费在线观看| 国产精品欧美综合在线| 91啪亚洲精品| 亚洲mv大片欧洲mv大片精品| 在线电影院国产精品| 久久er精品视频| 国产亚洲美州欧州综合国| 成人av片在线观看| 亚洲自拍偷拍网站| 欧美色网站导航| 久久99国产乱子伦精品免费| 欧美激情在线一区二区| 色综合久久久网| 午夜伊人狠狠久久| 日韩免费性生活视频播放| 国产福利不卡视频| 亚洲人成伊人成综合网小说| 3751色影院一区二区三区| 国产伦理精品不卡| 一区二区三区四区不卡在线| 欧美美女bb生活片| 国产成人精品免费一区二区| 亚洲天堂中文字幕| 欧美大片顶级少妇| 国产91精品久久久久久久网曝门| 一个色在线综合| 精品理论电影在线观看| www.日韩在线| 激情综合色综合久久综合| 亚洲视频你懂的| 精品久久久久一区| 一本久久精品一区二区| 激情久久五月天| 亚洲伊人伊色伊影伊综合网| 精品国产一区二区三区不卡| 日本道精品一区二区三区| 国产福利视频一区二区三区| 午夜激情久久久| 亚洲色欲色欲www| 久久久久久久久久久久久夜| 欧美在线999| 99视频精品免费视频| 黄色成人免费在线| 亚洲v中文字幕| 亚洲视频小说图片| 欧美激情一区三区| 精品国产一区二区三区四区四 | 美腿丝袜一区二区三区| 亚洲免费在线观看| 国产丝袜欧美中文另类| 欧美酷刑日本凌虐凌虐| 一本色道亚洲精品aⅴ| 国产福利视频一区二区三区| 麻豆一区二区在线| 婷婷综合另类小说色区| 亚洲最色的网站| 亚洲日本一区二区| 国产精品午夜在线观看| 久久综合网色—综合色88| 欧美mv和日韩mv国产网站| 欧美一区二区女人| 91精品国产欧美一区二区成人 | 91麻豆6部合集magnet| 国产91精品露脸国语对白| 国产一区二区三区免费看| 久久成人免费电影| 蜜臀久久99精品久久久久宅男| 日本vs亚洲vs韩国一区三区 | 国产成人午夜高潮毛片| 久久精品理论片| 久久99精品久久久久久动态图| 男女激情视频一区| 免费观看在线综合| 国产一区二区视频在线| 国产麻豆视频一区| 成人激情视频网站| 99久久99久久精品免费看蜜桃| 99精品黄色片免费大全| 91麻豆自制传媒国产之光| 在线观看一区二区精品视频| 欧美体内she精高潮| 7777精品久久久大香线蕉| 51精品视频一区二区三区| 精品久久免费看| 国产精品麻豆欧美日韩ww| 亚洲精品国产无天堂网2021 | 日韩欧美不卡在线观看视频| 日韩女优av电影在线观看| 国产亚洲视频系列| 一区二区三区加勒比av| 日日夜夜精品免费视频| 蜜桃久久久久久久| 丰满白嫩尤物一区二区| 欧美怡红院视频| 精品福利一区二区三区| 国产精品欧美综合在线| 午夜电影久久久| 国产尤物一区二区在线| 91视频在线观看免费| 4438成人网| 国产精品免费av| 天天操天天综合网| 成人午夜在线免费| 欧美日韩国产中文| 欧美—级在线免费片| 亚洲成av人**亚洲成av**| 国产精品一二三四| 欧美三级日韩三级| 国产欧美日韩久久| 日韩国产欧美三级| heyzo一本久久综合| 日韩一级黄色片| 亚洲欧美日韩一区二区三区在线观看| 日韩电影在线免费看| 99精品热视频| 国产亚洲成aⅴ人片在线观看| 亚洲男人的天堂一区二区| 国内精品国产成人| 欧美日韩精品三区|