PageRenderTime 52ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseError.java

#
Java | 63 lines | 25 code | 10 blank | 28 comment | 0 complexity | 7c70d3334bdc1f3408db77d60ad5d4bd MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. package org.apache.hadoop.hive.ql.parse;
  19. import org.antlr.runtime.BaseRecognizer;
  20. import org.antlr.runtime.RecognitionException;
  21. /*
  22. * SemanticException.java
  23. *
  24. * Created on April 1, 2008, 1:20 PM
  25. *
  26. * To change this template, choose Tools | Template Manager
  27. * and open the template in the editor.
  28. */
  29. /**
  30. *
  31. */
  32. public class ParseError {
  33. private final BaseRecognizer br;
  34. private final RecognitionException re;
  35. private final String[] tokenNames;
  36. ParseError(BaseRecognizer br, RecognitionException re, String[] tokenNames) {
  37. this.br = br;
  38. this.re = re;
  39. this.tokenNames = tokenNames;
  40. }
  41. BaseRecognizer getBaseRecognizer() {
  42. return br;
  43. }
  44. RecognitionException getRecognitionException() {
  45. return re;
  46. }
  47. String[] getTokenNames() {
  48. return tokenNames;
  49. }
  50. String getMessage() {
  51. return br.getErrorHeader(re) + " " + br.getErrorMessage(re, tokenNames);
  52. }
  53. }