10#define DEBUG_TCLPARSER 0
16 TclParser(Tcl_Interp* interp, std::string_view input);
29 [[nodiscard]] std::string
getColors()
const {
return colors; }
33 [[nodiscard]]
int getLast()
const {
return last.back(); }
37 [[nodiscard]]
static bool isProc(Tcl_Interp* interp, std::string_view str);
40 enum ParseType { COMMAND, EXPRESSION, OTHER };
42 void parse(
const char* p,
int size, ParseType type);
43 void printTokens(std::span<const Tcl_Token> tokens);
44 [[nodiscard]]
static ParseType guessSubType(std::span<const Tcl_Token> tokens,
size_t i);
45 void setColors(
const char* p,
int size,
char c);
51 std::vector<int> last;
58 #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)