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, std::string_view input)
 Input: Tcl interpreter and command to parse

 
const 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.
 
int getLast () const
 Get Start of the last subcommand.
 

Static Public Member Functions

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

Detailed Description

Definition at line 12 of file TclParser.hh.

Constructor & Destructor Documentation

◆ TclParser()

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

Input: Tcl interpreter and command to parse

Definition at line 70 of file TclParser.cc.

Member Function Documentation

◆ getColors()

const 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 29 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 33 of file TclParser.hh.

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

◆ isProc()

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

Is the given string a valid Tcl command.

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

Definition at line 228 of file TclParser.cc.

References tmpStrCat().


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