Namespace: Consultingwerk.Framework.ExpressionParser
Class 
LogicalExpressionParser Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:LogicalExpressionParser
Purpose:Parses a logical expression
Description:Returns true or false for the given expression
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Sat Jun 21 10:20:33 CEST 2014
Notes:Parses the logical expression and splits it into individual
value expressions. Supports & for AND, | for OR and ! for
NOT. Supports parenthesis between individual terms:
(A|B)&(C|D) will turn into (A OR B) AND (C OR D)
Parenthesis will be threated as part of an invividual
expression when a non " ", &, |, !, (, ) character has
started the individual expression. So
(A|B())&(C(test)|D) will turn into
(A OR B()) AND (C(test) OR D) where A, B(), C(test) AND D
will be passed as value expressions to the logical value
provider.
The Logical value provider is expected to return TRUE or
FALSE based on the given values



Top Method Summary
Options Name Purpose
+ LOGICAL Evaluate (character) Evaluates a logical expression

Top Constructor Summary
Options Name Purpose
LogicalExpressionParser () Static Constructor for the LogicalExpressionParser class
+ LogicalExpressionParser (ILogicalValueProvider) Constructor for the LogicalExpressionParser class

Top Property Summary
Options Name Purpose
+ Consultingwerk.Framework.ExpressionParser.ILogicalValueProvider LogicalValueProvider Returns the reference to the value provider used by this instance


Method Detail
Top

PUBLIC LOGICAL Evaluate (character)

Purpose: Evaluates a logical expression
Notes: Parses logical expressions, supports the following logical operators:
& AND
| OR
! NOT
Supports for double/single quoted expressions
Supports parenthesis

Parameters:
pcExpression CHARACTER
The logical expression to evaluate
Returns LOGICAL
The expression result


Constructor Detail
Top

STATIC LogicalExpressionParser ()

Purpose: Static Constructor for the LogicalExpressionParser class
Notes: Creates single temp-table record required by expression parser

Top

PUBLIC LogicalExpressionParser (ILogicalValueProvider)

Purpose: Constructor for the LogicalExpressionParser class
Notes:

Parameters:
poValueProvider Consultingwerk.Framework.ExpressionParser.ILogicalValueProvider
The ILogicalValueProvider that provides the values for the expression parser


Property Detail
Top

PUBLIC Consultingwerk.Framework.ExpressionParser.ILogicalValueProvider LogicalValueProvider

Purpose: Returns the reference to the value provider used by this instance
Notes:

Returns Consultingwerk.Framework.ExpressionParser.ILogicalValueProvider


©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:28:50