Package org.antlr.runtime.debug
Class RemoteDebugEventSocketListener
- java.lang.Object
-
- org.antlr.runtime.debug.RemoteDebugEventSocketListener
-
- All Implemented Interfaces:
java.lang.Runnable
public class RemoteDebugEventSocketListener extends java.lang.Object implements java.lang.Runnable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteDebugEventSocketListener.ProxyTokenstatic classRemoteDebugEventSocketListener.ProxyTree
-
Field Summary
Fields Modifier and Type Field Description (package private) java.net.Socketchannel(package private) java.lang.Stringeventjava.lang.StringgrammarFileName(package private) java.io.BufferedReaderin(package private) DebugEventListenerlistener(package private) java.lang.Stringmachine(package private) static intMAX_EVENT_ELEMENTS(package private) java.io.PrintWriterout(package private) intport(package private) intpreviousTokenIndexTrack the last token index we saw during a consume.(package private) booleantokenIndexesInvalidjava.lang.StringversionVersion of ANTLR (dictates events)
-
Constructor Summary
Constructors Constructor Description RemoteDebugEventSocketListener(DebugEventListener listener, java.lang.String machine, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidack()protected voidcloseConnection()protected RemoteDebugEventSocketListener.ProxyTreedeserializeNode(java.lang.String[] elements, int offset)protected RemoteDebugEventSocketListener.ProxyTokendeserializeToken(java.lang.String[] elements, int offset)protected voiddispatch(java.lang.String line)protected voideventHandler()java.lang.String[]getEventElements(java.lang.String event)protected voidhandshake()protected booleanopenConnection()voidrun()voidstart()Create a thread to listen to the remote running recognizerbooleantokenIndexesAreInvalid()protected java.lang.StringunEscapeNewlines(java.lang.String txt)
-
-
-
Field Detail
-
MAX_EVENT_ELEMENTS
static final int MAX_EVENT_ELEMENTS
- See Also:
- Constant Field Values
-
listener
DebugEventListener listener
-
machine
java.lang.String machine
-
port
int port
-
channel
java.net.Socket channel
-
out
java.io.PrintWriter out
-
in
java.io.BufferedReader in
-
event
java.lang.String event
-
version
public java.lang.String version
Version of ANTLR (dictates events)
-
grammarFileName
public java.lang.String grammarFileName
-
previousTokenIndex
int previousTokenIndex
Track the last token index we saw during a consume. If same, then set a flag that we have a problem.
-
tokenIndexesInvalid
boolean tokenIndexesInvalid
-
-
Constructor Detail
-
RemoteDebugEventSocketListener
public RemoteDebugEventSocketListener(DebugEventListener listener, java.lang.String machine, int port) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
eventHandler
protected void eventHandler()
-
openConnection
protected boolean openConnection()
-
closeConnection
protected void closeConnection()
-
handshake
protected void handshake() throws java.io.IOException- Throws:
java.io.IOException
-
ack
protected void ack()
-
dispatch
protected void dispatch(java.lang.String line)
-
deserializeNode
protected RemoteDebugEventSocketListener.ProxyTree deserializeNode(java.lang.String[] elements, int offset)
-
deserializeToken
protected RemoteDebugEventSocketListener.ProxyToken deserializeToken(java.lang.String[] elements, int offset)
-
start
public void start()
Create a thread to listen to the remote running recognizer
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
getEventElements
public java.lang.String[] getEventElements(java.lang.String event)
-
unEscapeNewlines
protected java.lang.String unEscapeNewlines(java.lang.String txt)
-
tokenIndexesAreInvalid
public boolean tokenIndexesAreInvalid()
-
-