openMSX
Public Member Functions | Static Public Member Functions | List of all members
TclParser Class Reference

#include <TclParser.hh>

Public Member Functions

 TclParser (Tcl_Interp *interp, string_view input)
 Input: Tcl interpreter and command to parse. More...
 
std::string getColors () const
 Ouput: a string of equal length of the input command where each character indicates the type of the corresponding character in the command. More...
 
int getLast () const
 Get Start of the last subcommand. More...
 

Static Public Member Functions

static bool isProc (Tcl_Interp *interp, string_view str)
 Is the given string a valid Tcl command. More...
 

Detailed Description

Definition at line 10 of file TclParser.hh.

Constructor & Destructor Documentation

◆ TclParser()

TclParser::TclParser ( Tcl_Interp *  interp,
string_view  input 
)

Input: Tcl interpreter and command to parse.

Definition at line 70 of file TclParser.cc.

References detail::size().

Member Function Documentation

◆ getColors()

std::string TclParser::getColors ( ) const
inline

Ouput: a string of equal length of the input command where each character indicates the type of the corresponding character in the command.

Currently the possible colors are: 'E' -> error 'c' -> comment 'v' -> variable 'l' -> literal (string or number) 'p' -> proc 'o' -> operator '.' -> other

Definition at line 27 of file TclParser.hh.

◆ getLast()

int TclParser::getLast ( ) const
inline

Get Start of the last subcommand.

This is the command that should be completed by tab-completion.

Definition at line 31 of file TclParser.hh.

References DEBUG_PRINT, isProc(), and detail::size().

Referenced by openmsx::GlobalCommandController::tabCompletion().

◆ isProc()

bool TclParser::isProc ( Tcl_Interp *  interp,
string_view  str 
)
static

Is the given string a valid Tcl command.

This also takes the 'lazy' Tcl scripts into account.

Definition at line 234 of file TclParser.cc.

References gl::min(), and strCat().

Referenced by getLast().


The documentation for this class was generated from the following files: