CppBlockFinishingInfo.java
上传用户:afrynkmhm
上传日期:2007-01-06
资源大小:1262k
文件大小:1k
源码类别:

编译器/解释器

开发平台:

Others

  1. package antlr;
  2. /* ANTLR Translator Generator
  3.  * Project led by Terence Parr at http://www.jGuru.com
  4.  * Software rights: http://www.antlr.org/RIGHTS.html
  5.  *
  6.  * $Id: //depot/code/org.antlr/release/antlr-2.7.0/antlr/CppBlockFinishingInfo.java#1 $
  7.  */
  8. // C++ code generator by Pete Wells: pete@yamuna.demon.co.uk
  9. class CppBlockFinishingInfo {
  10. String postscript; // what to generate to terminate block
  11. boolean generatedSwitch;// did block finish with "default:" of switch?
  12. boolean generatedAnIf;
  13. /** When generating an if or switch, end-of-token lookahead sets
  14.  *  will become the else or default clause, don't generate an
  15.  *  error clause in this case.
  16.  */
  17. boolean needAnErrorClause;
  18. public CppBlockFinishingInfo() {
  19. postscript=null;
  20. generatedSwitch=false;
  21. needAnErrorClause = true;
  22. }
  23. public CppBlockFinishingInfo(String ps, boolean genS, boolean generatedAnIf, boolean n) {
  24. postscript = ps;
  25. generatedSwitch = genS;
  26. this.generatedAnIf = generatedAnIf;
  27. needAnErrorClause = n;
  28. }
  29. }