LibreOffice Module basic (master) 1
|
#include <token.hxx>
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) |
StarBASIC * | GetBasic () |
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) |
SbiTokenizer::SbiTokenizer | ( | const OUString & | rSrc, |
StarBASIC * | pb = nullptr |
||
) |
|
inline |
Definition at line 123 of file token.hxx.
References SbiScanner::GenError().
Referenced by SbiSymPool::Add(), SbiParser::Assign(), SbiParser::Attribute(), SbiParser::BadBlock(), SbiParser::Channel(), SbiSymPool::CheckRefs(), SbiParser::DefDeclare(), SbiParser::DefEnum(), SbiSymPool::Define(), SbiParser::DefProc(), SbiParser::DefStatic(), SbiParser::DefType(), SbiParser::DefVar(), SbiParser::DefXXX(), SbiParser::DoLoop(), Error(), SbiParser::Exit(), SbiExprNode::FoldConstantsBinaryNode(), SbiExprNode::FoldConstantsUnaryNode(), SbiParser::For(), SbiCodeGen::Gen(), SbiExprNode::GenElement(), SbiConstExpression::GetShortValue(), SbiParser::Goto(), SbiParser::If(), SbiParser::Implements(), SbiParser::Input(), SbiExpression::Like(), SbiParser::LineInput(), SbiParser::LSet(), SbiProcDef::Match(), SbiParser::NoIf(), SbiExpression::ObjTerm(), SbiParser::On(), SbiParser::OnGoto(), SbiParser::Open(), SbiExpression::Operand(), SbiParser::Option(), SbiParser::Parse(), SbiExprList::ParseDimList(), SbiExprList::ParseParameters(), SbiParser::ProcDecl(), Push(), SbiParser::Resume(), SbiParser::RSet(), SbiCodeGen::Save(), SbiConstExpression::SbiConstExpression(), SbiParser::Select(), SbiParser::Set(), SbiParser::StmntBlock(), SbiParser::Symbol(), SbiExpression::Term(), SbiParser::TestComma(), SbiParser::TestEoln(), SbiParser::TestSymbol(), SbiParser::TestToken(), SbiParser::TypeDecl(), SbiParser::VarDecl(), and SbiParser::With().
void SbiTokenizer::Error | ( | ErrCode | code, |
const OUString & | aMsg | ||
) |
Definition at line 234 of file token.cxx.
References SbiScanner::aError, code, and Error().
|
static |
Definition at line 562 of file token.cxx.
References aTokTable_Basic, and o3tl::equalsIgnoreAsciiCase().
Referenced by SbModule::GetKeywordCase().
|
inline |
Definition at line 113 of file token.hxx.
References bEof.
Referenced by SbiParser::DefEnum(), SbiParser::DefType(), SbiParser::If(), SbiParser::Parse(), SbModule::SetSource32(), and SbiParser::StmntBlock().
|
inlinestatic |
Definition at line 127 of file token.hxx.
References EOLN, EOS, REM, and t.
Referenced by SbiParser::Close(), SbiParser::DoLoop(), SbiParser::If(), Next(), SbiParser::Parse(), SbiExprList::ParseParameters(), SbiParser::Print(), SbiParser::Select(), SbiParser::TestComma(), SbiParser::TestEoln(), and SbiParser::Write().
|
inline |
|
inlinestatic |
Definition at line 131 of file token.hxx.
References FIRSTEXTRA, and t.
Referenced by SbiExpression::ObjTerm().
|
inlinestatic |
Definition at line 129 of file token.hxx.
References FIRSTKWD, LASTKWD, and t.
Referenced by SbiParser::Implements(), SbiExpression::ObjTerm(), SbiExpression::Operand(), SbiExpression::Term(), and SbiParser::TypeDecl().
bool SbiTokenizer::MayBeLabel | ( | bool | bNeedsColon = false | ) |
Definition at line 545 of file token.cxx.
References SbiScanner::DoesColonFollow(), eCurTok, SbiScanner::eScanType, NUMBER, SbiScanner::nVal, SbxINTEGER, and SYMBOL.
Referenced by SbiParser::Goto(), SbiParser::On(), SbiParser::OnGoto(), SbiParser::Parse(), SbiParser::Resume(), and SbiParser::Return().
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().
SbiToken SbiTokenizer::Peek | ( | ) |
Definition at line 248 of file token.cxx.
References eCurTok, ePush, SbiScanner::nCol1, SbiScanner::nCol2, Next(), NIL, SbiScanner::nLine, nPCol1, nPCol2, and nPLine.
Referenced by SbiExpression::AddSub(), SbiExpression::Boolean(), SbiExpression::Cat(), SbiParser::Channel(), SbiParser::Close(), SbiExpression::Comp(), SbiParser::DefEnum(), SbiParser::DefStatic(), SbiParser::DefType(), SbiParser::DefVar(), SbiParser::DefXXX(), SbiExpression::Exp(), SbiParser::For(), SbiParser::If(), SbiParser::Implements(), SbiParser::Input(), SbiExpression::IntDiv(), SbiExpression::Like(), SbiParser::Line(), SbiExpression::Mod(), SbiExpression::MulDiv(), SbiParser::Name(), Next(), SbiExpression::ObjTerm(), SbiParser::On(), SbiParser::Open(), SbiExpression::Operand(), SbiParser::Parse(), SbiExprList::ParseDimList(), SbiExprList::ParseParameters(), SbiParser::Print(), SbiParser::ProcDecl(), SbiParser::Select(), SbiParser::Set(), SbiParser::Stop(), SbiParser::Symbol(), SbiExpression::Term(), SbiParser::TestComma(), SbiParser::TestSymbol(), SbiParser::TestToken(), SbiParser::TypeDecl(), SbiExpression::Unary(), SbiParser::VarDecl(), SbiExpression::VBA_Not(), and SbiParser::Write().
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().
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().
|
protected |
|
protected |
|
protected |
Definition at line 109 of file token.hxx.
Referenced by Next(), and SbiParser::Parse().
|
protected |
Definition at line 103 of file token.hxx.
Referenced by SbiParser::Attribute(), SbiParser::Close(), SbiParser::DefDeclare(), SbiParser::DefProc(), SbiParser::DefVar(), SbiParser::DefXXX(), SbiParser::Goto(), SbiParser::If(), SbiParser::Implements(), MayBeLabel(), Next(), SbiParser::On(), SbiParser::Option(), SbiParser::Parse(), Peek(), SbiParser::Print(), SbiParser::ProcDecl(), and SbiParser::TestSymbol().
|
protected |
|
protected |
Definition at line 105 of file token.hxx.
Referenced by SbiParser::If(), Next(), and Peek().
|
protected |
Definition at line 105 of file token.hxx.
Referenced by SbiParser::If(), Next(), and Peek().
|
protected |
Definition at line 105 of file token.hxx.
Referenced by SbiParser::If(), Next(), and Peek().