' This library is free software; you can redistribute it and/or ' modify it under the terms of the GNU Lesser General Public License ' as published by the Free Software Foundation; either version 2.1 ' of the License, or (at your option) any later version. ' ' This library is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ' Lesser General Public License for more details. ' ' You should have received a copy of the GNU Lesser General Public ' License along with this library; if not, write to the Free ' Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, ' MA 02111-1307, USA. ' ' Flee - Fast Lightweight Expression Evaluator ' Copyright © 2007 Eugene Ciloci ' ''' Public Interface IExpression ''' Function Clone() As IExpression ''' ReadOnly Property Text() As String ''' ReadOnly Property Info() As ExpressionInfo ''' ReadOnly Property Context() As ExpressionContext ''' Property Owner() As Object End Interface ''' Public Interface IDynamicExpression Inherits IExpression ''' Function Evaluate() As Object End Interface ''' Public Interface IGenericExpression(Of T) Inherits IExpression ''' Function Evaluate() As T End Interface ''' Public NotInheritable Class ExpressionInfo Private MyData As IDictionary(Of String, Object) Friend Sub New() MyData = New Dictionary(Of String, Object) MyData.Add("ReferencedVariables", New Dictionary(Of String, String)(StringComparer.OrdinalIgnoreCase)) End Sub Friend Sub AddReferencedVariable(ByVal name As String) Dim dict As IDictionary(Of String, String) = MyData.Item("ReferencedVariables") dict.Item(name) = name End Sub ''' Public Function GetReferencedVariables() As String() Dim dict As IDictionary(Of String, String) = MyData.Item("ReferencedVariables") Dim arr(dict.Count - 1) As String dict.Keys.CopyTo(arr, 0) Return arr End Function End Class ''' _ Public NotInheritable Class ExpressionOwnerMemberAccessAttribute Inherits Attribute Private MyAllowAccess As Boolean ''' Public Sub New(ByVal allowAccess As Boolean) MyAllowAccess = allowAccess End Sub Friend ReadOnly Property AllowAccess() As Boolean Get Return MyAllowAccess End Get End Property End Class ''' Public Class ResolveVariableTypeEventArgs Inherits EventArgs Private MyName As String Private MyType As Type Friend Sub New(ByVal name As String) Me.MyName = name End Sub ''' Public ReadOnly Property VariableName() As String Get Return MyName End Get End Property ''' Public Property VariableType() As Type Get Return MyType End Get Set(ByVal value As Type) MyType = value End Set End Property End Class ''' Public Class ResolveVariableValueEventArgs Inherits EventArgs Private MyName As String Private MyType As Type Private MyValue As Object Friend Sub New(ByVal name As String, ByVal t As Type) MyName = name MyType = t End Sub ''' Public ReadOnly Property VariableName() As String Get Return MyName End Get End Property ''' Public ReadOnly Property VariableType() As Type Get Return MyType End Get End Property ''' Public Property VariableValue() As Object Get Return MyValue End Get Set(ByVal value As Object) MyValue = value End Set End Property End Class ''' Public Class ResolveFunctionEventArgs Inherits EventArgs Private MyName As String Private MyArgumentTypes As Type() Private MyReturnType As Type Friend Sub New(ByVal name As String, ByVal argumentTypes As Type()) MyName = name MyArgumentTypes = argumentTypes End Sub ''' Public ReadOnly Property FunctionName() As String Get Return MyName End Get End Property ''' Public ReadOnly Property ArgumentTypes() As Type() Get Return MyArgumentTypes End Get End Property ''' Public Property ReturnType() As Type Get Return MyReturnType End Get Set(ByVal value As Type) MyReturnType = value End Set End Property End Class ''' Public Class InvokeFunctionEventArgs Inherits EventArgs Private MyName As String Private MyArguments As Object() Private MyFunctionResult As Object Friend Sub New(ByVal name As String, ByVal arguments As Object()) MyName = name MyArguments = arguments End Sub ''' Public ReadOnly Property FunctionName() As String Get Return MyName End Get End Property ''' Public ReadOnly Property Arguments() As Object() Get Return MyArguments End Get End Property ''' Public Property Result() As Object Get Return MyFunctionResult End Get Set(ByVal value As Object) MyFunctionResult = value End Set End Property End Class ''' Public Enum RealLiteralDataType ''' [Single] ''' [Double] ''' [Decimal] End Enum