java.lang.Object
com.maddyhome.idea.vim.ex.CommandParser
- public class CommandParser
- extends java.lang.Object
Maintains a tree of Ex commands based on the required and optional parts of the command names. Parses and
executes Ex commands entered by the user.
|
Constructor Summary |
private |
CommandParser()
Don't let anyone create one of these. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
root
private CommandNode root
ourInstance
private static CommandParser ourInstance
STATE_START
private static final int STATE_START
- See Also:
- Constant Field Values
STATE_COMMAND
private static final int STATE_COMMAND
- See Also:
- Constant Field Values
STATE_CMD_ARG
private static final int STATE_CMD_ARG
- See Also:
- Constant Field Values
STATE_RANGE
private static final int STATE_RANGE
- See Also:
- Constant Field Values
STATE_RANGE_LINE
private static final int STATE_RANGE_LINE
- See Also:
- Constant Field Values
STATE_RANGE_CURRENT
private static final int STATE_RANGE_CURRENT
- See Also:
- Constant Field Values
STATE_RANGE_LAST
private static final int STATE_RANGE_LAST
- See Also:
- Constant Field Values
STATE_RANGE_MARK
private static final int STATE_RANGE_MARK
- See Also:
- Constant Field Values
STATE_RANGE_MARK_CHAR
private static final int STATE_RANGE_MARK_CHAR
- See Also:
- Constant Field Values
STATE_RANGE_ALL
private static final int STATE_RANGE_ALL
- See Also:
- Constant Field Values
STATE_RANGE_PATTERN
private static final int STATE_RANGE_PATTERN
- See Also:
- Constant Field Values
STATE_RANGE_SHORT_PATTERN
private static final int STATE_RANGE_SHORT_PATTERN
- See Also:
- Constant Field Values
STATE_RANGE_PATTERN_MAYBE_DONE
private static final int STATE_RANGE_PATTERN_MAYBE_DONE
- See Also:
- Constant Field Values
STATE_RANGE_OFFSET
private static final int STATE_RANGE_OFFSET
- See Also:
- Constant Field Values
STATE_RANGE_OFFSET_NUM
private static final int STATE_RANGE_OFFSET_NUM
- See Also:
- Constant Field Values
STATE_RANGE_OFFSET_DONE
private static final int STATE_RANGE_OFFSET_DONE
- See Also:
- Constant Field Values
STATE_RANGE_OFFSET_MAYBE_DONE
private static final int STATE_RANGE_OFFSET_MAYBE_DONE
- See Also:
- Constant Field Values
STATE_RANGE_SEPARATOR
private static final int STATE_RANGE_SEPARATOR
- See Also:
- Constant Field Values
STATE_RANGE_MAYBE_DONE
private static final int STATE_RANGE_MAYBE_DONE
- See Also:
- Constant Field Values
STATE_RANGE_DONE
private static final int STATE_RANGE_DONE
- See Also:
- Constant Field Values
STATE_ERROR
private static final int STATE_ERROR
- See Also:
- Constant Field Values
logger
private static Logger logger
CommandParser
private CommandParser()
- Don't let anyone create one of these.
getInstance
public static CommandParser getInstance()
- There is only one parser.
registerHandlers
public void registerHandlers()
- Registers all the supported Ex commands
processLastCommand
public boolean processLastCommand(Editor editor,
DataContext context,
int count)
throws ExException
- Used to rerun the last Ex command, if any
processCommand
public void processCommand(Editor editor,
DataContext context,
java.lang.String cmd,
int count)
throws ExException
- Parse and execute an Ex command entered by the user
parse
public ParseResult parse(java.lang.String cmd)
throws ExException
- Parse the text entered by the user. This does not include the leading colon.
addHandler
public void addHandler(CommandHandler handler)
- Adds a command handler to the parser