< prev index next >

src/jdk.rmic/share/classes/sun/tools/java/Scanner.java

Print this page


   1 /*
   2  * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  41  * token in the input.<p>
  42  *
  43  * The match() method is used to quickly match opening
  44  * brackets (ie: '(', '{', or '[') with their closing
  45  * counter part. This is useful during error recovery.<p>
  46  *
  47  * An position consists of: ((linenr << WHEREOFFSETBITS) | offset)
  48  * this means that both the line number and the exact offset into
  49  * the file are encoded in each position value.<p>
  50  *
  51  * The compiler treats either "\n", "\r" or "\r\n" as the
  52  * end of a line.<p>
  53  *
  54  * WARNING: The contents of this source file are not part of any
  55  * supported API.  Code that depends on them does so at its own risk:
  56  * they are subject to change or removal without notice.
  57  *
  58  * @author      Arthur van Hoff
  59  */
  60 

  61 public
  62 class Scanner implements Constants {
  63     /**
  64      * The increment for each character.
  65      */
  66     public static final long OFFSETINC = 1;
  67 
  68     /**
  69      * The increment for each line.
  70      */
  71     public static final long LINEINC = 1L << WHEREOFFSETBITS;
  72 
  73     /**
  74      * End of input
  75      */
  76     public static final int EOF = -1;
  77 
  78     /**
  79      * Where errors are reported
  80      */


   1 /*
   2  * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  41  * token in the input.<p>
  42  *
  43  * The match() method is used to quickly match opening
  44  * brackets (ie: '(', '{', or '[') with their closing
  45  * counter part. This is useful during error recovery.<p>
  46  *
  47  * An position consists of: ((linenr << WHEREOFFSETBITS) | offset)
  48  * this means that both the line number and the exact offset into
  49  * the file are encoded in each position value.<p>
  50  *
  51  * The compiler treats either "\n", "\r" or "\r\n" as the
  52  * end of a line.<p>
  53  *
  54  * WARNING: The contents of this source file are not part of any
  55  * supported API.  Code that depends on them does so at its own risk:
  56  * they are subject to change or removal without notice.
  57  *
  58  * @author      Arthur van Hoff
  59  */
  60 
  61 @SuppressWarnings("deprecation")
  62 public
  63 class Scanner implements Constants {
  64     /**
  65      * The increment for each character.
  66      */
  67     public static final long OFFSETINC = 1;
  68 
  69     /**
  70      * The increment for each line.
  71      */
  72     public static final long LINEINC = 1L << WHEREOFFSETBITS;
  73 
  74     /**
  75      * End of input
  76      */
  77     public static final int EOF = -1;
  78 
  79     /**
  80      * Where errors are reported
  81      */


< prev index next >