9 #define DEBUG_TCLPARSER 0
15 TclParser(Tcl_Interp* interp, std::string_view input);
28 [[nodiscard]] std::string
getColors()
const {
return colors; }
32 [[nodiscard]]
int getLast()
const {
return last.back(); }
36 [[nodiscard]]
static bool isProc(Tcl_Interp* interp, std::string_view str);
39 enum ParseType { COMMAND, EXPRESSION, OTHER };
41 void parse(
const char* p,
int size, ParseType type);
42 void printTokens(Tcl_Token* tokens,
int numTokens);
43 [[nodiscard]]
static ParseType guessSubType(Tcl_Token* tokens,
int i);
44 void setColors(
const char* p,
int size,
char c);
50 std::vector<int> last;
57 #define DEBUG_PRINT(x)
TclParser(Tcl_Interp *interp, std::string_view input)
Input: Tcl interpreter and command to parse
static bool isProc(Tcl_Interp *interp, std::string_view str)
Is the given string a valid Tcl command.
int getLast() const
Get Start of the last subcommand.
std::string getColors() const
Ouput: a string of equal length of the input command where each character indicates the type of the c...
size_t size(std::string_view utf8)