Class TMathParser (unit BSParser)

Inherits from

TComponent

TokenRec

Constructors


constructor Create(AOwner: TComponent);



Functions

procedure Parse;

Push

function GotoState(Production : Word) : Word;

defaults

function IsFunc(S : String) : Boolean;

GotoState

function IsVar(var Value : Extended) : Boolean;

IsFunc

function NextToken : TokenTypes;

IsVar

procedure Pop(var Token : TokenRec);

NextToken

procedure Push(Token : TokenRec);

Pop

procedure Reduce(Reduction : Word);

Parse

procedure Shift(State : Word);

Reduce

Properties

property ParseString : string


Events

event OnGetVar : TGetVarEvent

Published declarations

event OnParseError : TParseErrorEvent


Variables

ParseError : Boolean;


ParseValue : Extended;


Position : Word;

Public declarations

CurrToken : TokenRec;

Protected declarations

MathError : Boolean;


Stack : array[1..ParserStackSize] of TokenRec;


StackTop : 0..ParserStackSize;


TokenError : ErrorRange;


TokenLen : Word;


TokenType : TokenTypes;


FInput : string;

Private declarations

FOnGetVar : TGetVarEvent;


FOnParseError : TParseErrorEvent;



Constructors


constructor Create(AOwner: TComponent);


Functions


procedure Parse;

Push


function GotoState(Production : Word) : Word;

defaults


function IsFunc(S : String) : Boolean;

GotoState


function IsVar(var Value : Extended) : Boolean;

IsFunc


function NextToken : TokenTypes;

IsVar


procedure Pop(var Token : TokenRec);

NextToken


procedure Push(Token : TokenRec);

Pop


procedure Reduce(Reduction : Word);

Parse


procedure Shift(State : Word);

Reduce


Properties


property ParseString : string


Events


event OnGetVar : TGetVarEvent

Published declarations


event OnParseError : TParseErrorEvent


Variables


ParseError : Boolean;


ParseValue : Extended;


Position : Word;

Public declarations


CurrToken : TokenRec;

Protected declarations


MathError : Boolean;


Stack : array[1..ParserStackSize] of TokenRec;


StackTop : 0..ParserStackSize;


TokenError : ErrorRange;


TokenLen : Word;


TokenType : TokenTypes;


FInput : string;

Private declarations


FOnGetVar : TGetVarEvent;


FOnParseError : TParseErrorEvent;