LibreOffice Module basic (master) 1
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
SbiTokenizer Class Reference

#include <token.hxx>

Inheritance diagram for SbiTokenizer:
[legend]
Collaboration diagram for SbiTokenizer:
[legend]

Public Member Functions

 SbiTokenizer (const OUString &, StarBASIC *=nullptr)
 
bool IsEof () const
 
bool IsEos () const
 
void Push (SbiToken)
 
const OUString & Symbol (SbiToken)
 
SbiToken Peek ()
 
SbiToken Next ()
 
bool MayBeLabel (bool=false)
 
void Error (ErrCode c)
 
void Error (ErrCode, SbiToken)
 
void Error (ErrCode, const OUString &)
 
- Public Member Functions inherited from SbiScanner
 SbiScanner (OUString, StarBASIC *=nullptr)
 
void EnableErrors ()
 
bool IsHash () const
 
bool IsCompatible () const
 
void SetCompatible (bool b)
 
bool IsVBASupportOn () const
 
bool WhiteSpace () const
 
sal_Int32 GetErrors () const
 
sal_Int32 GetLine () const
 
sal_Int32 GetCol1 () const
 
void SetCol1 (sal_Int32 n)
 
StarBASICGetBasic ()
 
void SaveLine ()
 
void RestoreLine ()
 
void LockColumn ()
 
void UnlockColumn ()
 
bool DoesColonFollow ()
 
bool NextSym ()
 
const OUString & GetSym () const
 
SbxDataType GetType () const
 
double GetDbl () const
 

Static Public Member Functions

static bool IsEoln (SbiToken t)
 
static bool IsKwd (SbiToken t)
 
static bool IsExtra (SbiToken t)
 
static OUString GetKeywordCase (std::u16string_view sKeyword)
 

Protected Attributes

SbiToken eCurTok
 
SbiToken ePush
 
sal_uInt16 nPLine
 
sal_uInt16 nPCol1
 
sal_uInt16 nPCol2
 
bool bEof
 
bool bEos
 
bool bAs
 
bool bErrorIsSymbol
 
- Protected Attributes inherited from SbiScanner
OUString aSym
 
OUString aError
 
SbxDataType eScanType
 
double nVal
 
sal_Int32 nSavedCol1
 
sal_Int32 nCol
 
sal_Int32 nErrors
 
sal_Int32 nColLock
 
sal_Int32 nBufPos
 
sal_Int32 nLine
 
sal_Int32 nCol1
 
sal_Int32 nCol2
 
bool bSymbol
 
bool bNumber
 
bool bSpaces
 
bool bAbort
 
bool bHash
 
bool bError
 
bool bCompatible
 
bool bVBASupportOn
 
bool bPrevLineExtentsComment
 
bool bClosingUnderscore
 
bool bLineEndsWithWhitespace
 
bool bInStatement
 

Additional Inherited Members

- Protected Member Functions inherited from SbiScanner
void GenError (ErrCode)
 

Detailed Description

Definition at line 101 of file token.hxx.

Constructor & Destructor Documentation

◆ SbiTokenizer()

SbiTokenizer::SbiTokenizer ( const OUString &  rSrc,
StarBASIC pb = nullptr 
)

Definition at line 213 of file token.cxx.

Member Function Documentation

◆ Error() [1/3]

void SbiTokenizer::Error ( ErrCode  c)
inline

◆ Error() [2/3]

void SbiTokenizer::Error ( ErrCode  code,
const OUString &  aMsg 
)

Definition at line 234 of file token.cxx.

References SbiScanner::aError, code, and Error().

◆ Error() [3/3]

void SbiTokenizer::Error ( ErrCode  code,
SbiToken  tok 
)

Definition at line 240 of file token.cxx.

References SbiScanner::aError, code, Error(), and Symbol().

◆ GetKeywordCase()

OUString SbiTokenizer::GetKeywordCase ( std::u16string_view  sKeyword)
static

Definition at line 562 of file token.cxx.

References aTokTable_Basic, and o3tl::equalsIgnoreAsciiCase().

Referenced by SbModule::GetKeywordCase().

◆ IsEof()

bool SbiTokenizer::IsEof ( ) const
inline

◆ IsEoln()

static bool SbiTokenizer::IsEoln ( SbiToken  t)
inlinestatic

◆ IsEos()

bool SbiTokenizer::IsEos ( ) const
inline

Definition at line 114 of file token.hxx.

References bEos.

Referenced by SbiParser::Parse().

◆ IsExtra()

static bool SbiTokenizer::IsExtra ( SbiToken  t)
inlinestatic

Definition at line 131 of file token.hxx.

References FIRSTEXTRA, and t.

Referenced by SbiExpression::ObjTerm().

◆ IsKwd()

static bool SbiTokenizer::IsKwd ( SbiToken  t)
inlinestatic

◆ MayBeLabel()

bool SbiTokenizer::MayBeLabel ( bool  bNeedsColon = false)

◆ Next()

SbiToken SbiTokenizer::Next ( void  )

Definition at line 309 of file token.cxx.

References APPEND, AS, SbiScanner::aSym, aTokTable_Basic, bAs, SbiScanner::bCompatible, bEof, bEos, bErrorIsSymbol, SbiScanner::bInStatement, SbiScanner::bNumber, SbiScanner::bSymbol, ch, CLASSMODULE, DATATYPE1, DATATYPE2, DIM, eCurTok, ELSE, END, ENDENUM, ENDFUNC, ENDIF, ENDPROPERTY, ENDSELECT, ENDSUB, ENDTYPE, ENDWITH, ENUM, EOLN, ePush, ERROR_, SbiScanner::eScanType, EXPON, FIXSTRING, FUNCTION, GET, IDIV, IF, IMPLEMENTS, BasicCharClass::isAlpha(), IsEoln(), LINE, NAME, SbiScanner::nCol, SbiScanner::nCol1, SbiScanner::nCol2, Next(), SbiScanner::NextSym(), NIL, SbiScanner::nLine, nPCol1, nPCol2, nPLine, NUMBER, PARAMARRAY, Peek(), PROPERTY, REM, SbiScanner::RestoreLine(), SbiScanner::SaveLine(), SbxDATE, SbxSTRING, SbxVARIANT, SELECT, STOP, SUB, SYMBOL, TEXT, THEN, TYPE, TYPEOF, and WITH.

Referenced by SbiExpression::AddSub(), SbiParser::Attribute(), SbiExpression::Boolean(), SbiExpression::Cat(), SbiParser::Channel(), SbiParser::Close(), SbiExpression::Comp(), SbiParser::DefDeclare(), SbiParser::DefEnum(), SbiParser::DefProc(), SbiParser::DefStatic(), SbiParser::DefType(), SbiParser::DefVar(), SbiParser::DefXXX(), SbiParser::DoLoop(), SbiParser::Exit(), SbiExpression::Exp(), SbiParser::For(), SbiParser::Goto(), SbiParser::If(), SbiParser::Implements(), SbiParser::Input(), SbiExpression::IntDiv(), SbiExpression::Like(), SbiParser::Line(), SbiExpression::Mod(), SbiExpression::MulDiv(), Next(), SbiExpression::ObjTerm(), SbiParser::On(), SbiParser::OnGoto(), SbiParser::Open(), SbiExpression::Operand(), SbiParser::Option(), SbiParser::Parse(), SbiExprList::ParseDimList(), SbiExprList::ParseParameters(), Peek(), SbiParser::Print(), SbiParser::ProcDecl(), SbiParser::Resume(), SbiParser::Return(), SbiParser::Select(), SbiParser::Set(), SbModule::SetSource32(), SbiExpression::Term(), SbiParser::TestComma(), SbiParser::TestEoln(), SbiParser::TestSymbol(), SbiParser::TestToken(), SbiParser::TypeDecl(), SbiExpression::Unary(), SbiParser::VarDecl(), SbiExpression::VBA_Not(), and SbiParser::Write().

◆ Peek()

SbiToken SbiTokenizer::Peek ( )

◆ Push()

void SbiTokenizer::Push ( SbiToken  t)

Definition at line 227 of file token.cxx.

References ePush, ERRCODE_BASIC_INTERNAL_ERROR, Error(), NIL, and t.

Referenced by SbiParser::If(), and SbiParser::Parse().

◆ Symbol()

const OUString & SbiTokenizer::Symbol ( SbiToken  t)

Definition at line 266 of file token.cxx.

References SbiScanner::aSym, aTokTable_Basic, EOLN, EOS, FIRSTKWD, NEG, p, and t.

Referenced by Error(), SbiParser::On(), and SbiParser::Option().

Member Data Documentation

◆ bAs

bool SbiTokenizer::bAs
protected

Definition at line 108 of file token.hxx.

Referenced by Next().

◆ bEof

bool SbiTokenizer::bEof
protected

Definition at line 106 of file token.hxx.

Referenced by IsEof(), and Next().

◆ bEos

bool SbiTokenizer::bEos
protected

Definition at line 107 of file token.hxx.

Referenced by IsEos(), and Next().

◆ bErrorIsSymbol

bool SbiTokenizer::bErrorIsSymbol
protected

Definition at line 109 of file token.hxx.

Referenced by Next(), and SbiParser::Parse().

◆ eCurTok

SbiToken SbiTokenizer::eCurTok
protected

◆ ePush

SbiToken SbiTokenizer::ePush
protected

Definition at line 104 of file token.hxx.

Referenced by Next(), SbiParser::Parse(), Peek(), and Push().

◆ nPCol1

sal_uInt16 SbiTokenizer::nPCol1
protected

Definition at line 105 of file token.hxx.

Referenced by SbiParser::If(), Next(), and Peek().

◆ nPCol2

sal_uInt16 SbiTokenizer::nPCol2
protected

Definition at line 105 of file token.hxx.

Referenced by SbiParser::If(), Next(), and Peek().

◆ nPLine

sal_uInt16 SbiTokenizer::nPLine
protected

Definition at line 105 of file token.hxx.

Referenced by SbiParser::If(), Next(), and Peek().


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