LibreOffice Module basic (master) 1
Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
SbiParser Class Reference

#include <parser.hxx>

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

Public Member Functions

 SbiParser (StarBASIC *, SbModule *)
 
 ~SbiParser ()
 
bool Parse ()
 
void SetCodeCompleting (bool b)
 
bool IsCodeCompleting () const
 
SbiExprNodeGetWithVar ()
 
SbiSymDefCheckRTLForSym (const OUString &rSym, SbxDataType eType)
 
void AddConstants ()
 
bool HasGlobalCode ()
 
bool TestToken (SbiToken)
 
bool TestSymbol ()
 
bool TestComma ()
 
void TestEoln ()
 
void Symbol (const KeywordSymbolInfo *pKeywordSymbolInfo)
 
void ErrorStmnt ()
 
void BadBlock ()
 
void NoIf ()
 
void Assign ()
 
void Attribute ()
 
void Call ()
 
void Close ()
 
void Declare ()
 
void DefXXX ()
 
void Dim ()
 
void ReDim ()
 
void Erase ()
 
void Exit ()
 
void For ()
 
void Goto ()
 
void If ()
 
void Implements ()
 
void Input ()
 
void Line ()
 
void LineInput ()
 
void LSet ()
 
void Name ()
 
void On ()
 
void OnGoto ()
 
void Open ()
 
void Option ()
 
void Print ()
 
void SubFunc ()
 
void Resume ()
 
void Return ()
 
void RSet ()
 
void DoLoop ()
 
void Select ()
 
void Set ()
 
void Static ()
 
void Stop ()
 
void Type ()
 
void Enum ()
 
void While ()
 
void With ()
 
void Write ()
 
- Public Member Functions inherited from SbiTokenizer
 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
 

Public Attributes

SbxArrayRef rTypeArray
 
SbxArrayRef rEnumArray
 
SbiStringPool aGblStrings
 
SbiStringPool aLclStrings
 
SbiSymPool aGlobals
 
SbiSymPool aPublics
 
SbiSymPool aRtlSyms
 
SbiCodeGen aGen
 
SbiSymPoolpPool
 
short nBase
 
bool bExplicit
 
bool bClassModule
 
std::vector< OUString > aIfaceVector
 
std::vector< OUString > aRequiredTypes
 
SbxDataType eDefTypes [N_DEF_TYPES]
 

Private Member Functions

SbiSymDefVarDecl (SbiExprListPtr *, bool, bool)
 
SbiProcDefProcDecl (bool bDecl)
 
void DefStatic (bool bPrivate)
 
void DefProc (bool bStatic, bool bPrivate)
 
void DefVar (SbiOpcode eOp, bool bStatic)
 
void TypeDecl (SbiSymDef &, bool bAsNewAlreadyParsed=false)
 
void OpenBlock (SbiToken, SbiExprNode *=nullptr)
 
void CloseBlock ()
 
bool Channel (bool bAlways=false)
 
void StmntBlock (SbiToken)
 
void DefType ()
 
void DefEnum (bool bPrivate)
 
void DefDeclare (bool bPrivate)
 
void EnableCompatibility ()
 

Static Private Member Functions

static bool IsUnoInterface (const OUString &sTypeName)
 

Private Attributes

SbiParseStackpStack
 
SbiProcDefpProc
 
SbiExprNodepWithVar
 
SbiToken eEndTok
 
sal_uInt32 nGblChain
 
bool bGblDefs
 
bool bNewGblDefs
 
bool bSingleLineIf
 
bool bCodeCompleting
 

Friends

class SbiExpression
 

Additional Inherited Members

- Static Public Member Functions inherited from SbiTokenizer
static bool IsEoln (SbiToken t)
 
static bool IsKwd (SbiToken t)
 
static bool IsExtra (SbiToken t)
 
static OUString GetKeywordCase (std::u16string_view sKeyword)
 
- Protected Member Functions inherited from SbiScanner
void GenError (ErrCode)
 
- Protected Attributes inherited from SbiTokenizer
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
 

Detailed Description

Definition at line 31 of file parser.hxx.

Constructor & Destructor Documentation

◆ SbiParser()

SbiParser::SbiParser ( StarBASIC pb,
SbModule pm 
)

◆ ~SbiParser()

SbiParser::~SbiParser ( )

Definition at line 154 of file parser.cxx.

Member Function Documentation

◆ AddConstants()

void SbiParser::AddConstants ( )

Definition at line 850 of file parser.cxx.

References addNumericConst(), addStringConst(), aPublics, and u.

Referenced by EnableCompatibility().

◆ Assign()

void SbiParser::Assign ( )

◆ Attribute()

void SbiParser::Attribute ( )

◆ BadBlock()

void SbiParser::BadBlock ( )

Definition at line 292 of file loops.cxx.

References eEndTok, ERRCODE_BASIC_BAD_BLOCK, and SbiTokenizer::Error().

◆ Call()

void SbiParser::Call ( )

Definition at line 1184 of file dim.cxx.

References aGen, FORCE_CALL, SbiExpression::Gen(), SbiCodeGen::Gen(), GET_, and SbSYMBOL.

◆ Channel()

bool SbiParser::Channel ( bool  bAlways = false)
private

◆ CheckRTLForSym()

SbiSymDef * SbiParser::CheckRTLForSym ( const OUString &  rSym,
SbxDataType  eType 
)

◆ Close()

void SbiParser::Close ( )

◆ CloseBlock()

void SbiParser::CloseBlock ( )
private

Definition at line 211 of file parser.cxx.

References aGen, SbiCodeGen::BackChain(), SbiCodeGen::DecForLevel(), FOR, p, pStack, and pWithVar.

Referenced by DefProc(), DoLoop(), For(), and With().

◆ Declare()

void SbiParser::Declare ( )

Definition at line 1038 of file dim.cxx.

References DefDeclare().

◆ DefDeclare()

void SbiParser::DefDeclare ( bool  bPrivate)
private

◆ DefEnum()

void SbiParser::DefEnum ( bool  bPrivate)
private

◆ DefProc()

void SbiParser::DefProc ( bool  bStatic,
bool  bPrivate 
)
private

◆ DefStatic()

void SbiParser::DefStatic ( bool  bPrivate)
private

◆ DefType()

void SbiParser::DefType ( )
private

◆ DefVar()

void SbiParser::DefVar ( SbiOpcode  eOp,
bool  bStatic 
)
private

Definition at line 202 of file dim.cxx.

References SbiSymPool::Add(), aGblStrings, aGen, aGlobals, SbiCodeGen::BackChain(), SbiScanner::bCompatible, bGblDefs, bNewGblDefs, SbiScanner::bVBASupportOn, CheckRTLForSym(), CONST_, CREATE_, DCREATE_, DCREATE_REDIMP_, DECLARE, DefDeclare(), DefEnum(), DefProc(), DefStatic(), DefType(), DIM_, SbiTokenizer::eCurTok, SbiScanner::EnableErrors(), ENUM, EQ, ERASE_, ERASE_CLEAR_, ERRCODE_BASIC_NOT_IN_SUBR, ERRCODE_BASIC_SYNTAX, ERRCODE_BASIC_UNDEF_TYPE, ERRCODE_BASIC_UNEXPECTED, ERRCODE_BASIC_VAR_DEFINED, SbiTokenizer::Error(), SbiSymPool::Find(), SbiStringPool::Find(), FIND_, FUNCTION, SbiExpression::Gen(), SbiCodeGen::Gen(), SbiScanner::GetBasic(), SbiSymDef::GetConstDef(), SbiSymDef::GetFixedStringLength(), SbiSymDef::GetId(), SbiSymDef::GetName(), SbiSymDef::GetScope(), SbiConstExpression::GetString(), SbiConstExpression::GetType(), SbiSymDef::GetType(), SbiSymDef::GetTypeId(), SbiConstExpression::GetValue(), GLOBAL, GLOBAL_, GLOBAL_P_, SbiSymDef::IsDefinedAs(), CodeCompleteOptions::IsExtendedTypeDeclaration(), SbiSymDef::IsNew(), SbiSymDef::IsStatic(), IsUnoInterface(), SbiExpression::IsValid(), SbiSymDef::IsWithEvents(), JUMP_, JUMPT_, LOCAL_, SbiTokenizer::Next(), nGblChain, Object, SbiTokenizer::Peek(), pPool, pProc, PRESERVE, PRIVATE, PROPERTY, PUBLIC, PUBLIC_, PUBLIC_P_, PUTC_, REDIM_, REDIMP_, REDIMP_ERASE_, rTypeArray, SbGLOBAL, SbLOCAL, SbPARAM, SbPUBLIC, SBX_FIXED_LEN_STRING_FLAG, SBX_TYPE_DIM_AS_NEW_FLAG, SBX_TYPE_VAR_TO_DIM_FLAG, SBX_TYPE_WITH_EVENTS_FLAG, SbxOBJECT, SbxSTRING, SbxVARIANT, SbiConstDef::Set(), SET_, SbiSymDef::SetDims(), SbiSymDef::SetGlobal(), SHARED, SbiCodeGen::Statement(), STATIC, STATIC_, SUB, TCREATE_, TestComma(), TestToken(), TYPE, VarDecl(), and VBASET_.

Referenced by DefStatic(), Dim(), and ReDim().

◆ DefXXX()

void SbiParser::DefXXX ( )

◆ Dim()

void SbiParser::Dim ( )

Definition at line 197 of file dim.cxx.

References SbiScanner::bVBASupportOn, DefVar(), DIM_, SbiSymDef::IsStatic(), and pProc.

◆ DoLoop()

void SbiParser::DoLoop ( )

◆ EnableCompatibility()

void SbiParser::EnableCompatibility ( )
private

Definition at line 754 of file parser.cxx.

References AddConstants(), and SbiScanner::bCompatible.

Referenced by Option(), and SbiParser().

◆ Enum()

void SbiParser::Enum ( )

Definition at line 716 of file dim.cxx.

References DefEnum().

◆ Erase()

void SbiParser::Erase ( )

◆ ErrorStmnt()

void SbiParser::ErrorStmnt ( )

Definition at line 891 of file parser.cxx.

References aGen, ERROR_, SbiExpression::Gen(), and SbiCodeGen::Gen().

◆ Exit()

void SbiParser::Exit ( )

◆ For()

void SbiParser::For ( )

◆ GetWithVar()

SbiExprNode * SbiParser::GetWithVar ( )

Definition at line 472 of file parser.cxx.

References p, pStack, and pWithVar.

Referenced by SbiExpression::Term().

◆ Goto()

void SbiParser::Goto ( )

◆ HasGlobalCode()

bool SbiParser::HasGlobalCode ( )

Definition at line 185 of file parser.cxx.

References aGen, SbiCodeGen::BackChain(), bGblDefs, SbiCodeGen::Gen(), LEAVE_, and nGblChain.

Referenced by SbiCodeGen::Save().

◆ If()

void SbiParser::If ( )

◆ Implements()

void SbiParser::Implements ( )

◆ Input()

void SbiParser::Input ( )

◆ IsCodeCompleting()

bool SbiParser::IsCodeCompleting ( ) const
inline

◆ IsUnoInterface()

bool SbiParser::IsUnoInterface ( const OUString &  sTypeName)
staticprivate

Definition at line 1349 of file dim.cxx.

References Exception, and comphelper::getProcessComponentContext().

Referenced by DefVar().

◆ Line()

void SbiParser::Line ( )

◆ LineInput()

void SbiParser::LineInput ( )

◆ LSet()

void SbiParser::LSet ( )

◆ Name()

void SbiParser::Name ( )

◆ NoIf()

void SbiParser::NoIf ( )

Definition at line 145 of file loops.cxx.

References ENDIF, ERRCODE_BASIC_NO_IF, SbiTokenizer::Error(), and StmntBlock().

◆ On()

void SbiParser::On ( )

◆ OnGoto()

void SbiParser::OnGoto ( )

◆ Open()

void SbiParser::Open ( )

◆ OpenBlock()

void SbiParser::OpenBlock ( SbiToken  eTok,
SbiExprNode pVar = nullptr 
)
private

Definition at line 196 of file parser.cxx.

References aGen, FOR, SbiCodeGen::IncForLevel(), p, pStack, and pWithVar.

Referenced by DefProc(), DoLoop(), For(), and With().

◆ Option()

void SbiParser::Option ( )

◆ Parse()

bool SbiParser::Parse ( )

◆ Print()

void SbiParser::Print ( )

◆ ProcDecl()

SbiProcDef * SbiParser::ProcDecl ( bool  bDecl)
private

◆ ReDim()

void SbiParser::ReDim ( )

Definition at line 578 of file dim.cxx.

References SbiScanner::bVBASupportOn, DefVar(), SbiSymDef::IsStatic(), pProc, and REDIM_.

◆ Resume()

void SbiParser::Resume ( )

◆ Return()

void SbiParser::Return ( )

◆ RSet()

void SbiParser::RSet ( )

◆ Select()

void SbiParser::Select ( )

◆ Set()

void SbiParser::Set ( )

◆ SetCodeCompleting()

void SbiParser::SetCodeCompleting ( bool  b)

Definition at line 316 of file parser.cxx.

References bCodeCompleting.

◆ Static()

void SbiParser::Static ( )

Definition at line 1310 of file dim.cxx.

References DefStatic().

◆ StmntBlock()

void SbiParser::StmntBlock ( SbiToken  eEnd)
private

◆ Stop()

void SbiParser::Stop ( )

Definition at line 705 of file parser.cxx.

References aGen, SbiCodeGen::Gen(), SbiTokenizer::Peek(), and STOP_.

◆ SubFunc()

void SbiParser::SubFunc ( )

Definition at line 1193 of file dim.cxx.

References DefProc().

◆ Symbol()

void SbiParser::Symbol ( const KeywordSymbolInfo pKeywordSymbolInfo)

◆ TestComma()

bool SbiParser::TestComma ( )

◆ TestEoln()

void SbiParser::TestEoln ( )

◆ TestSymbol()

bool SbiParser::TestSymbol ( )

◆ TestToken()

bool SbiParser::TestToken ( SbiToken  t)

◆ Type()

void SbiParser::Type ( )

Definition at line 598 of file dim.cxx.

References DefType().

◆ TypeDecl()

void SbiParser::TypeDecl ( SbiSymDef rDef,
bool  bAsNewAlreadyParsed = false 
)
private

◆ VarDecl()

SbiSymDef * SbiParser::VarDecl ( SbiExprListPtr ppDim,
bool  bStatic,
bool  bConst 
)
private

◆ While()

void SbiParser::While ( )

◆ With()

void SbiParser::With ( )

◆ Write()

void SbiParser::Write ( )

Friends And Related Function Documentation

◆ SbiExpression

friend class SbiExpression
friend

Definition at line 33 of file parser.hxx.

Referenced by Input(), and Open().

Member Data Documentation

◆ aGblStrings

SbiStringPool SbiParser::aGblStrings

◆ aGen

SbiCodeGen SbiParser::aGen

◆ aGlobals

SbiSymPool SbiParser::aGlobals

Definition at line 65 of file parser.hxx.

Referenced by DefEnum(), DefVar(), and SbiParser().

◆ aIfaceVector

std::vector<OUString> SbiParser::aIfaceVector

Definition at line 73 of file parser.hxx.

Referenced by Implements(), and SbiCodeGen::Save().

◆ aLclStrings

SbiStringPool SbiParser::aLclStrings

Definition at line 64 of file parser.hxx.

◆ aPublics

SbiSymPool SbiParser::aPublics

◆ aRequiredTypes

std::vector<OUString> SbiParser::aRequiredTypes

Definition at line 74 of file parser.hxx.

Referenced by SbiCodeGen::Save(), and TypeDecl().

◆ aRtlSyms

SbiSymPool SbiParser::aRtlSyms

Definition at line 67 of file parser.hxx.

Referenced by CheckRTLForSym(), and SbiParser().

◆ bClassModule

bool SbiParser::bClassModule

Definition at line 72 of file parser.hxx.

Referenced by SbiExprNode::Gen(), Implements(), Option(), and SbiParser().

◆ bCodeCompleting

bool SbiParser::bCodeCompleting
private

Definition at line 43 of file parser.hxx.

Referenced by IsCodeCompleting(), and SetCodeCompleting().

◆ bExplicit

bool SbiParser::bExplicit

Definition at line 71 of file parser.hxx.

Referenced by Option(), and SbiCodeGen::Save().

◆ bGblDefs

bool SbiParser::bGblDefs
private

Definition at line 40 of file parser.hxx.

Referenced by DefEnum(), DefVar(), and HasGlobalCode().

◆ bNewGblDefs

bool SbiParser::bNewGblDefs
private

Definition at line 41 of file parser.hxx.

Referenced by DefDeclare(), DefEnum(), DefStatic(), DefVar(), and Parse().

◆ bSingleLineIf

bool SbiParser::bSingleLineIf
private

Definition at line 42 of file parser.hxx.

Referenced by If(), and Parse().

◆ eDefTypes

SbxDataType SbiParser::eDefTypes[N_DEF_TYPES]

Definition at line 76 of file parser.hxx.

Referenced by DefXXX(), SbiParser(), and SbiSymDef::SetType().

◆ eEndTok

SbiToken SbiParser::eEndTok
private

Definition at line 38 of file parser.hxx.

Referenced by BadBlock(), Parse(), and StmntBlock().

◆ nBase

short SbiParser::nBase

Definition at line 70 of file parser.hxx.

Referenced by DefType(), SbiExpression::Gen(), Option(), and SbiCodeGen::Save().

◆ nGblChain

sal_uInt32 SbiParser::nGblChain
private

Definition at line 39 of file parser.hxx.

Referenced by DefDeclare(), DefEnum(), DefStatic(), DefVar(), HasGlobalCode(), Parse(), and SbiParser().

◆ pPool

SbiSymPool* SbiParser::pPool

Definition at line 69 of file parser.hxx.

Referenced by DefEnum(), DefProc(), DefStatic(), DefVar(), SbiParser(), and SbiExpression::Term().

◆ pProc

SbiProcDef* SbiParser::pProc
private

◆ pStack

SbiParseStack* SbiParser::pStack
private

Definition at line 35 of file parser.hxx.

Referenced by CloseBlock(), Exit(), GetWithVar(), and OpenBlock().

◆ pWithVar

SbiExprNode* SbiParser::pWithVar
private

Definition at line 37 of file parser.hxx.

Referenced by CloseBlock(), GetWithVar(), and OpenBlock().

◆ rEnumArray

SbxArrayRef SbiParser::rEnumArray

Definition at line 62 of file parser.hxx.

Referenced by DefEnum(), SbiCodeGen::Save(), SbiParser(), and TypeDecl().

◆ rTypeArray

SbxArrayRef SbiParser::rTypeArray

Definition at line 61 of file parser.hxx.

Referenced by DefType(), DefVar(), SbiCodeGen::Save(), and SbiParser().


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