亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? clsexpression.cls

?? ERP管理系統源代碼erp 管理系統源代碼
?? CLS
?? 第 1 頁 / 共 2 頁
字號:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsExpressionParser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'
' clsExpression - Mathematical Expression Parser
' By Elad Rosenheim
'
' Read the readme.txt file first to have a grasp of
' what goes on in here.
'
' I advise you to try the parser with many expressions,
' including ones with syntax errors in them.
'

Private Const PI = 3.14159265358979

' A generic error text to raise when there's no specific text
Private Const GENERIC_SYNTAX_ERR_MSG = "公式表達式語法錯誤!"

' Parser Error codes
' The values PERR_FIRST and PERR_LAST allow the client app
' to test whether the error is a parser error or VB error
' See the demo form
Public Enum ParserErrors
    PERR_FIRST = vbObjectError + 513
    PERR_SYNTAX_ERROR = PERR_FIRST
    PERR_DIVISION_BY_ZERO
    PERR_CLOSING_PARENTHESES_EXPECTED
    PERR_INVALID_CONST_NAME
    PERR_FUNCTION_DOES_NOT_EXIST
    PERR_RESERVED_WORD
    PERR_CONST_ALREADY_EXISTS
    PERR_CONST_DOES_NOT_EXIST
    PERR_LAST = PERR_CONST_DOES_NOT_EXIST
End Enum

' Tokens (Operators) supported by the parser.
Private Enum ParserTokens
    TOK_UNKNOWN
    TOK_FIRST
    TOK_ADD = TOK_FIRST
    TOK_SUBTRACT
    TOK_MULTIPLY
    TOK_DIVIDE
    TOK_OPEN_PARENTHESES
    TOK_CLOSE_PARENTHESES
    TOK_LAST = TOK_CLOSE_PARENTHESES
End Enum

' This array holds the symbols used to represent operators.
' You may change them. For example, if you add a "not equal"
' operator, you may use '!=' or '<>' symbols for it
Private mTokenSymbols() As String

Private mExpression As String
' Current position where the parser is in the expression
Private mPosition As Long
Private mLastTokenLength As Long

' Holds user-defined and built-in constants
Private mConstants As Collection

' Holds the VB Project name - used by error handling code
Private mProjectName As String

' This function is the top-level parsing function, exposed
' to the client. Its sole logic is to check that there's no
' garbage at the end of the expression, since ParseNumExp
' and all the lower level function return when they
' run into something they don't identify - That's what runs
' the whole magic
Public Function ParseExpression(ByVal Expression As String) As Double
    On Error GoTo ParseExpression_ErrHandler
    Dim Value As Double

    mExpression = Expression
    mPosition = 1
    
    SkipSpaces
    Value = ParseNumExp
    SkipSpaces
    
    ' If ParseNumExp didn't parse the whole expression,
    ' it means there's some garbage at the end
    If mPosition <= Len(mExpression) Then
        Err.Raise PERR_SYNTAX_ERROR, , GENERIC_SYNTAX_ERR_MSG
    End If

    ParseExpression = Value
    Exit Function
ParseExpression_ErrHandler:
    ' The following call sets err.Source to the function
    ' name. If the error was raised by ParseNumExp, this
    ' function's name will be added to the existing
    ' err.Source, so the client can see exactly how the
    ' call stack looked like when the error occured
    SetErrSource "ParseExpression"
    Err.Raise Err.Number
End Function

' This function handles -/+ binary operations
Private Function ParseNumExp() As Double
    On Error GoTo ParseNumExp_ErrHandler
    Dim Value As Double
    Dim OtherValue As Double
    Dim CurrToken As ParserTokens

    ' ParseTerm knows how to handle * and / operators,
    ' which must be executed first
    Value = ParseTerm
    
    ' While we didn't reach the expression's end,
    ' check for more +/- operators
    Do While mPosition <= Len(mExpression)
        
        ' GetToken just gives us a peek at the next token,
        ' It does not change the current position. We skip
        ' over the token ONLY IF WE CAN HANDLE IT in this
        ' function's scope
        CurrToken = GetToken

        If CurrToken = TOK_ADD Then
            ' We can handle the token, so let's skip over it
            ' and find the "other side" of the + operation
            SkipLastToken
            OtherValue = ParseTerm
            Value = Value + OtherValue
        ElseIf CurrToken = TOK_SUBTRACT Then
            SkipLastToken
            OtherValue = ParseTerm
            Value = Value - OtherValue
        ElseIf CurrToken = TOK_UNKNOWN Then
            Err.Raise PERR_SYNTAX_ERROR, , GENERIC_SYNTAX_ERR_MSG
        Else
            ' The operator is one not in the responsibility
            ' of this function - we can return up
            ParseNumExp = Value
            Exit Function
        End If
    Loop

    ParseNumExp = Value
    Exit Function
ParseNumExp_ErrHandler:
    SetErrSource "ParseNumExp"
    Err.Raise Err.Number
End Function

' This function handles -/+ binary operations
' It is almost exactly the same as ParseNumExp
Private Function ParseTerm() As Double
    On Error GoTo ParseTerm_ErrHandler
    Dim Value As Double
    Dim OtherValue As Double
    Dim CurrToken As ParserTokens

    Value = ParseValue
    
    ' While we didn't reach the expression's end,
    ' check for more * or / operators
    Do While mPosition <= Len(mExpression)
        
        CurrToken = GetToken

        If CurrToken = TOK_MULTIPLY Then
            SkipLastToken
            
            OtherValue = ParseValue
            Value = Value * OtherValue
        ElseIf CurrToken = TOK_DIVIDE Then
            SkipLastToken
            
            OtherValue = ParseValue
            If OtherValue = 0 Then
                Err.Raise PERR_DIVISION_BY_ZERO, , _
                    "Division by Zero!"
            End If
            
            Value = Value / OtherValue
        ElseIf CurrToken = TOK_UNKNOWN Then
            Err.Raise PERR_SYNTAX_ERROR, , GENERIC_SYNTAX_ERR_MSG
        Else
            ParseTerm = Value
            Exit Function
        End If
    Loop

    ParseTerm = Value

    Exit Function
ParseTerm_ErrHandler:
    SetErrSource "ParseTerm"
    Err.Raise Err.Number
End Function

' This function reads a value that operators work on.
' The value can be a number, constant, function or a
' complete sub-expression (enclosed in parentheses (1+1) )
Private Function ParseValue() As Double
    On Error GoTo ParseValue_ErrHandler
    Dim Sign As Double
    Dim CurrToken As ParserTokens
    Dim Value As Double
    Dim IsValue As Boolean

    Sign = 1

    CurrToken = GetToken
    If CurrToken = TOK_SUBTRACT Then
        ' We ran into an UNARY minus (like -1), so we
        ' have to multiply the next value with -1
        Sign = -1
        SkipLastToken
    ElseIf CurrToken = TOK_ADD Then
        ' Unary plus - no special meaning
        SkipLastToken
    End If

    CurrToken = GetToken
    If CurrToken = TOK_OPEN_PARENTHESES Then
        ' A sub-expression
        SkipLastToken
        ' Read the value of the sub-expression.
        ' When ParseNumExp runs into the closing parentheses,
        ' it will return (is the syntax is correct).
        Value = ParseNumExp
        
        CurrToken = GetToken
        If CurrToken = TOK_CLOSE_PARENTHESES Then
            SkipLastToken
        Else
            ' Where are those closing parentheses ?
            Err.Raise PERR_CLOSING_PARENTHESES_EXPECTED, , "')' Expected"
        End If
    Else
        ' No sub-expression - It's an atom
        Value = ParseAtom
    End If

    ParseValue = Value * Sign
    Exit Function
ParseValue_ErrHandler:
    SetErrSource "ParseValue"
    Err.Raise Err.Number
End Function

' ParseAtom knows how to handle numbers, constants
' and functions
Private Function ParseAtom() As Double
    On Error GoTo ParseAtom_ErrHandler
    Dim CurrPosition As Long
    Dim CurrToken As ParserTokens
    Dim SymbolName As String
    Dim ArgumentValue As Double
    Dim DecimalPointFound As Boolean
    Dim Value As Double
    Dim IsValue As Boolean

    If mPosition > Len(mExpression) Then
        Err.Raise PERR_SYNTAX_ERROR, , GENERIC_SYNTAX_ERR_MSG
    End If

    CurrPosition = mPosition
    
    ' We didn't recoginze a valid value yet
    IsValue = False
    
    ' Check if the atom is a number typed in explicitly
    If IsNumeric(Mid(mExpression, CurrPosition, 1)) Then
        IsValue = True
        
        CurrPosition = CurrPosition + 1
        DecimalPointFound = False
        
        ' Read the rest of the number
        Do While IsNumeric(Mid(mExpression, CurrPosition, 1)) Or _
            Mid(mExpression, CurrPosition, 1) = "."
            
            If Mid(mExpression, CurrPosition, 1) = "." Then
                If Not DecimalPointFound Then
                    DecimalPointFound = True
                Else
                    ' Can't have the decimal point twice!
                    Err.Raise PERR_SYNTAX_ERROR, , GENERIC_SYNTAX_ERR_MSG
                End If
            End If
            
            CurrPosition = CurrPosition + 1
        Loop
        
        Value = CDbl(Mid(mExpression, mPosition, CurrPosition - mPosition))
        
        mPosition = CurrPosition
        SkipSpaces
    End If

    If Not IsValue Then
        ' Check if it's a constant/function name
        If IsLetter(Mid(mExpression, CurrPosition, 1)) Then
            CurrPosition = CurrPosition + 1
            
            ' Read the rest of the string. VB doesn't do
            ' "short-circuit" condition handling, so we have
            ' to put an If in the While loop
            Do While CurrPosition <= Len(mExpression)
                If IsValidSymbolCharacter(Mid(mExpression, CurrPosition, 1)) Then
                    CurrPosition = CurrPosition + 1
                Else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区四区的 | 欧美一级午夜免费电影| eeuss鲁片一区二区三区在线观看| 毛片av一区二区| 日韩—二三区免费观看av| 日韩在线一区二区| 日本午夜精品视频在线观看| 婷婷亚洲久悠悠色悠在线播放| 亚洲综合在线免费观看| 亚洲乱码国产乱码精品精可以看| 中文字幕在线一区二区三区| 国产精品国产a| 一区二区三区在线观看欧美| 亚洲国产日韩一区二区| 日本欧美在线观看| 国产一区二区精品在线观看| 成人深夜视频在线观看| 一本大道av一区二区在线播放| 一本色道久久综合精品竹菊| 欧美性受极品xxxx喷水| 精品欧美黑人一区二区三区| 亚洲国产经典视频| 一区二区三区四区在线免费观看 | 91.com视频| 2024国产精品视频| 亚洲图片你懂的| 轻轻草成人在线| 成人三级伦理片| 欧美日韩一区中文字幕| 精品三级在线观看| 综合分类小说区另类春色亚洲小说欧美| 一区二区三区在线观看欧美| 另类欧美日韩国产在线| 99视频在线精品| 欧美一区二区三区在| 国产精品视频一二| 视频一区国产视频| 99久久精品国产精品久久| 91精品在线一区二区| 欧美激情中文字幕一区二区| 亚洲国产视频一区二区| 国产麻豆欧美日韩一区| 欧美性猛片aaaaaaa做受| 国产性做久久久久久| 亚洲国产一区二区在线播放| 国产一区二区三区在线观看免费视频 | 亚洲麻豆国产自偷在线| 精品一区免费av| 日本韩国精品在线| 国产三级欧美三级| 美美哒免费高清在线观看视频一区二区 | 国产女人18毛片水真多成人如厕| 一区二区三区久久久| 成人免费视频国产在线观看| 日韩欧美国产三级| 亚洲一区在线观看视频| 成人高清在线视频| 久久久久免费观看| 喷白浆一区二区| 欧美影视一区二区三区| 国产精品国产三级国产aⅴ原创 | 在线观看欧美精品| 中文字幕国产一区二区| 国产一区二区精品久久91| 欧美日本免费一区二区三区| 亚洲精品v日韩精品| www.av亚洲| 国产精品欧美综合在线| 国产成人在线观看免费网站| 精品国产乱码久久久久久影片| 午夜国产不卡在线观看视频| 欧美写真视频网站| 性欧美大战久久久久久久久| 色婷婷精品大视频在线蜜桃视频| 亚洲欧美在线视频| 91在线视频观看| 亚洲欧美在线aaa| 色综合天天综合在线视频| 亚洲欧洲性图库| 91在线观看高清| 亚洲人成影院在线观看| 一本到三区不卡视频| 亚洲国产日韩一区二区| 欧美久久久久免费| 蜜臀a∨国产成人精品| 精品美女在线观看| 国产成人在线观看| 亚洲欧美怡红院| 欧美日精品一区视频| 日韩电影在线一区| 国产午夜精品福利| 国产乱码精品一区二区三区忘忧草 | 一区二区三区中文字幕电影 | 99精品一区二区| 一区二区三区中文在线观看| 欧美麻豆精品久久久久久| 男人的j进女人的j一区| 久久久久久久久一| 色婷婷国产精品| 麻豆freexxxx性91精品| 国产情人综合久久777777| 色综合天天天天做夜夜夜夜做| 偷拍一区二区三区四区| 国产日韩欧美精品综合| 91久久久免费一区二区| 久久国产婷婷国产香蕉| 中文成人综合网| 欧美精品777| 成人h动漫精品一区二| 亚洲高清免费观看| 久久精品在这里| 3d动漫精品啪啪| eeuss影院一区二区三区| 日本怡春院一区二区| 中文字幕成人av| 91精品国产综合久久久久久| 成人午夜精品一区二区三区| 五月婷婷久久丁香| 亚洲国产电影在线观看| 91精品国产综合久久福利| 丁香桃色午夜亚洲一区二区三区| 亚洲一区二区三区四区在线| 欧美国产日韩一二三区| 欧美电影在线免费观看| 99精品国产热久久91蜜凸| 日本午夜一本久久久综合| 亚洲美女一区二区三区| 国产亚洲一本大道中文在线| 3d动漫精品啪啪| 欧美视频一区二区三区在线观看| 成人精品国产一区二区4080| 麻豆国产91在线播放| 香港成人在线视频| 一个色综合av| 亚洲欧美福利一区二区| 中文字幕av一区二区三区免费看 | 国产999精品久久| 久久国产免费看| 免费不卡在线视频| 水蜜桃久久夜色精品一区的特点| 亚洲人成伊人成综合网小说| 国产精品日韩成人| 久久久www成人免费无遮挡大片 | 国产亚洲福利社区一区| 精品国产91亚洲一区二区三区婷婷| 欧美三日本三级三级在线播放| 91麻豆精品视频| 99免费精品在线观看| 成人国产在线观看| eeuss影院一区二区三区| 成av人片一区二区| caoporn国产精品| 91蝌蚪porny| 日本韩国一区二区三区| 在线观看日韩精品| 51精品视频一区二区三区| 7799精品视频| 欧美一二区视频| 26uuu精品一区二区三区四区在线| 精品久久久久久久久久久久久久久久久 | 激情五月婷婷综合网| 精品一区二区三区在线播放视频| 久久99这里只有精品| 国产精品99久久久久久久女警| 国产成人在线网站| 95精品视频在线| 欧美少妇bbb| 欧美一区二区大片| 久久综合狠狠综合| 国产精品久久久久久久久图文区 | 日韩不卡在线观看日韩不卡视频| 午夜精品久久久久久久久| 麻豆精品一区二区三区| 国内精品伊人久久久久av影院| 国产成人精品综合在线观看| 99精品欧美一区二区三区小说| 成人看片黄a免费看在线| 91福利国产精品| 欧美剧情电影在线观看完整版免费励志电影 | 一区二区成人在线视频| 亚洲bdsm女犯bdsm网站| 久国产精品韩国三级视频| 国产精品自拍网站| 欧美专区在线观看一区| 欧美成人一区二区| ...xxx性欧美| 蜜桃av一区二区| 91麻豆免费看| 精品久久久久久久久久久久久久久 | 欧美日韩成人在线| 久久久精品日韩欧美| 亚洲国产综合91精品麻豆| 国产在线播放一区二区三区| 色狠狠av一区二区三区| 久久久久亚洲蜜桃| 日韩国产高清影视| 91麻豆蜜桃一区二区三区| 久久婷婷色综合| 午夜精品视频在线观看| 成人黄动漫网站免费app|