LightJason - AgentSpeak(L++)
CErrorListener.java
Go to the documentation of this file.
1 /*
2  * @cond LICENSE
3  * ######################################################################################
4  * # LGPL License #
5  * # #
6  * # This file is part of the LightJason AgentSpeak(L++) #
7  * # Copyright (c) 2015-19, LightJason (info@lightjason.org) #
8  * # This program is free software: you can redistribute it and/or modify #
9  * # it under the terms of the GNU Lesser General Public License as #
10  * # published by the Free Software Foundation, either version 3 of the #
11  * # License, or (at your option) any later version. #
12  * # #
13  * # This program is distributed in the hope that it will be useful, #
14  * # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15  * # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16  * # GNU Lesser General Public License for more details. #
17  * # #
18  * # You should have received a copy of the GNU Lesser General Public License #
19  * # along with this program. If not, see http://www.gnu.org/licenses/ #
20  * ######################################################################################
21  * @endcond
22  */
23 
24 package org.lightjason.agentspeak.grammar;
25 
26 import org.antlr.v4.runtime.ANTLRErrorListener;
27 import org.antlr.v4.runtime.Parser;
28 import org.antlr.v4.runtime.RecognitionException;
29 import org.antlr.v4.runtime.Recognizer;
30 import org.antlr.v4.runtime.atn.ATNConfigSet;
31 import org.antlr.v4.runtime.dfa.DFA;
34 
35 import java.util.BitSet;
36 
37 
42 public final class CErrorListener implements ANTLRErrorListener
43 {
44  @Override
45  public void syntaxError( final Recognizer<?, ?> p_recognizer, final Object p_symbol, final int p_line, final int p_charposition,
46  final String p_message,
47  final RecognitionException p_exception
48  )
49  {
50  throw new CSyntaxErrorException( CCommon.languagestring( this, "syntax", p_line, p_charposition ) );
51  }
52 
53  @Override
54  public void reportAmbiguity( final Parser p_parser, final DFA p_dfa, final int p_startindex, final int p_stopindex, final boolean p_exact,
55  final BitSet p_alternatives,
56  final ATNConfigSet p_configuration
57  )
58  {
59 
60  }
61 
62  @Override
63  public void reportAttemptingFullContext( final Parser p_parser, final DFA p_dfa, final int p_startindex, final int p_stopindex,
64  final BitSet p_bitset,
65  final ATNConfigSet p_configuration
66  )
67  {
68 
69  }
70 
71  @Override
72  public void reportContextSensitivity( final Parser p_parser, final DFA p_dfa, final int p_startindex, final int p_stopindex,
73  final int p_prediction,
74  final ATNConfigSet p_configuration
75  )
76  {
77 
78  }
79 }
void reportContextSensitivity(final Parser p_parser, final DFA p_dfa, final int p_startindex, final int p_stopindex, final int p_prediction, final ATNConfigSet p_configuration)
void reportAmbiguity(final Parser p_parser, final DFA p_dfa, final int p_startindex, final int p_stopindex, final boolean p_exact, final BitSet p_alternatives, final ATNConfigSet p_configuration)
static< T > String languagestring(final T p_source, final String p_label, final Object... p_parameter)
returns the language depend string on any object
void syntaxError(final Recognizer<?, ?> p_recognizer, final Object p_symbol, final int p_line, final int p_charposition, final String p_message, final RecognitionException p_exception)
AntLR error lister to catch parser and lexer errors with individual error handling and language trans...
void reportAttemptingFullContext(final Parser p_parser, final DFA p_dfa, final int p_startindex, final int p_stopindex, final BitSet p_bitset, final ATNConfigSet p_configuration)