Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: Sidney Castro
Added: Oct 23, 2018 12:33 PM
Views: 13
Tags: no tags
  1.  
  2. /*
  3.  * Copyright © 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  4.  * California 95054, U.S.A. All rights reserved.  Sun Microsystems, Inc. has
  5.  * intellectual property rights relating to technology embodied in the product
  6.  * that is described in this document. In particular, and without limitation,
  7.  * these intellectual property rights may include one or more of the U.S.
  8.  * patents listed at http://www.sun.com/patents and one or more additional
  9.  * patents or pending patent applications in the U.S. and in other countries.
  10.  * U.S. Government Rights - Commercial software. Government users are subject
  11.  * to the Sun Microsystems, Inc. standard license agreement and applicable
  12.  * provisions of the FAR and its supplements.  Use is subject to license terms.
  13.  * Sun,  Sun Microsystems,  the Sun logo and  Java are trademarks or registered
  14.  * trademarks of Sun Microsystems, Inc. in the U.S. and other countries.  This
  15.  * product is covered and controlled by U.S. Export Control laws and may be
  16.  * subject to the export or import laws in other countries.  Nuclear, missile,
  17.  * chemical biological weapons or nuclear maritime end uses or end users,
  18.  * whether direct or indirect, are strictly prohibited.  Export or reexport
  19.  * to countries subject to U.S. embargo or to entities identified on U.S.
  20.  * export exclusion lists, including, but not limited to, the denied persons
  21.  * and specially designated nationals lists is strictly prohibited.
  22.  */
  23.  
  24.  
  25. options {
  26.   LOOKAHEAD = 1;
  27.   CHOICE_AMBIGUITY_CHECK = 2;
  28.   OTHER_AMBIGUITY_CHECK = 1;
  29.   STATIC = true;
  30.   DEBUG_PARSER = false;
  31.   DEBUG_LOOKAHEAD = false;
  32.   DEBUG_TOKEN_MANAGER = false;
  33.   ERROR_REPORTING = true;
  34.   JAVA_UNICODE_ESCAPE = false;
  35.   UNICODE_INPUT = false;
  36.   IGNORE_CASE = false;
  37.   USER_TOKEN_MANAGER = false;
  38.   USER_CHAR_STREAM = false;
  39.   BUILD_PARSER = true;
  40.   BUILD_TOKEN_MANAGER = true;
  41.   SANITY_CHECK = true;
  42.   FORCE_LA_CHECK = false;
  43. }
  44.  
  45. PARSER_BEGIN(Simple1)
  46.  
  47. public class Simple1 {
  48.  
  49.   public static void main(String args[]) throws ParseException {
  50.     Simple1 parser = new Simple1(System.in);
  51.     parser.Input();
  52.   }
  53.  
  54. }
  55.  
  56. PARSER_END(Simple1)
  57.  
  58. void Input() :
  59. {}
  60. {
  61.   MatchedBraces() ("\n"|"\r")* <EOF>
  62. }
  63.  
  64. void MatchedBraces() :
  65. {}
  66. {
  67.   "{" [ MatchedBraces() ] "}"
  68. }
  69.