1 /* |
1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
73 this.scannerFactory = ScannerFactory.instance(context); |
73 this.scannerFactory = ScannerFactory.instance(context); |
74 } |
74 } |
75 |
75 |
76 public Parser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap) { |
76 public Parser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap) { |
77 Lexer lexer = scannerFactory.newScanner(input, keepDocComments); |
77 Lexer lexer = scannerFactory.newScanner(input, keepDocComments); |
78 if (keepEndPos) { |
78 return new JavacParser(this, lexer, keepDocComments, keepLineMap, keepEndPos); |
79 return new EndPosParser(this, lexer, keepDocComments, keepLineMap); |
|
80 } else { |
|
81 return new JavacParser(this, lexer, keepDocComments, keepLineMap); |
|
82 } |
|
83 } |
79 } |
84 } |
80 } |