亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日本va欧美va欧美va精品| 久久精品人人做人人综合| 国产91精品一区二区麻豆亚洲| 亚欧色一区w666天堂| 亚洲视频综合在线| 国产精品日产欧美久久久久| 精品国产一区二区精华| 欧美电影免费提供在线观看| 日韩三级电影网址| xfplay精品久久| 日本一区二区高清| 最新国产精品久久精品| 中文字幕一区av| 亚洲午夜免费视频| 日韩电影在线免费| 精品一区二区三区久久| 精东粉嫩av免费一区二区三区| 国产成人在线视频免费播放| 成人黄色免费短视频| 91蜜桃传媒精品久久久一区二区| 99精品视频在线观看| 欧美在线视频不卡| 欧美日韩大陆一区二区| 日韩精品中文字幕在线一区| 26uuu久久天堂性欧美| 日本一区二区三区四区| 亚洲色图视频网| 日韩精品亚洲一区| 狠狠色综合日日| 一本大道综合伊人精品热热| 日韩欧美色综合| 国产精品久久久久一区二区三区 | 另类小说图片综合网| 国产精品自在欧美一区| 99国产一区二区三精品乱码| 欧美精品一二三| 国产午夜精品一区二区三区嫩草 | 国产视频一区在线观看| 亚洲黄色小视频| 六月丁香婷婷久久| aa级大片欧美| 欧美成人乱码一区二区三区| 中文天堂在线一区| 日欧美一区二区| 成人免费福利片| 911国产精品| 18成人在线观看| 国产综合久久久久久久久久久久| 色综合色综合色综合色综合色综合 | 成人av在线网| 日韩欧美综合一区| 国产精品每日更新在线播放网址| 午夜成人免费视频| 成人丝袜视频网| 日韩色视频在线观看| 亚洲欧美一区二区三区国产精品 | 色成年激情久久综合| 久久综合一区二区| 视频一区国产视频| 色婷婷av一区| |精品福利一区二区三区| 九一九一国产精品| 欧美羞羞免费网站| 国产精品久久精品日日| 国产在线视频一区二区三区| 欧美人妇做爰xxxⅹ性高电影| 一区视频在线播放| 高清国产一区二区| 久久久久久久久一| 激情综合色播激情啊| 欧美一区日韩一区| 日韩高清不卡一区二区| 欧美私人免费视频| 一区二区三区日本| 色综合久久久久综合体桃花网| 中文字幕日韩欧美一区二区三区| 国产伦精品一区二区三区免费迷| 欧美一卡2卡三卡4卡5免费| 亚洲风情在线资源站| 欧美日本韩国一区二区三区视频 | 波多野结衣中文一区| 久久综合九色综合97_久久久| 久久精品999| 精品免费国产二区三区| 激情综合网天天干| 国产亚洲欧美日韩俺去了| 国产精品一级片在线观看| 久久久久亚洲综合| 丰满少妇在线播放bd日韩电影| 国产日韩欧美制服另类| 99九九99九九九视频精品| 亚洲激情自拍视频| 欧美日韩高清不卡| 国产一区二区三区香蕉| 亚洲国产精品黑人久久久 | 亚洲一区二区免费视频| 一本在线高清不卡dvd| 一二三区精品福利视频| 欧美精品一卡二卡| 激情久久五月天| 最新中文字幕一区二区三区| 欧美综合视频在线观看| 日本欧美加勒比视频| 久久久亚洲午夜电影| 91麻豆视频网站| 日韩成人av影视| 国产欧美视频一区二区| 在线亚洲+欧美+日本专区| 蜜桃av一区二区在线观看| 国产精品久久久久久久久免费相片| 色噜噜狠狠成人中文综合| 蜜桃视频在线一区| 国产精品伦一区二区三级视频| 欧美揉bbbbb揉bbbbb| 国产一区二区女| 亚洲曰韩产成在线| 国产欧美精品一区| 欧美这里有精品| 国产精品主播直播| 一二三四区精品视频| 欧美激情综合五月色丁香小说| 欧美日韩视频一区二区| 成人av在线播放网址| 国产在线国偷精品免费看| 亚洲已满18点击进入久久| 亚洲国产精品精华液2区45| 91精品婷婷国产综合久久| 日本乱人伦aⅴ精品| 国产精品一二三四区| 日韩国产在线观看一区| 亚洲欧美日韩在线播放| 国产欧美一区二区精品婷婷| 精品剧情在线观看| 精品视频一区二区三区免费| 99国产精品久| 成人夜色视频网站在线观看| 免费在线观看精品| 亚洲成人自拍偷拍| 亚洲女同ⅹxx女同tv| 在线观看区一区二| 国产成人免费视频网站 | 国产欧美一区二区精品久导航| 色哟哟在线观看一区二区三区| 蜜桃一区二区三区在线观看| 国产精品欧美经典| 在线播放日韩导航| 91色在线porny| 国产一区二区三区四区五区入口 | 亚洲欧洲日本在线| 久久综合av免费| 6080国产精品一区二区| 欧美性感一区二区三区| 成人黄色av网站在线| 麻豆国产一区二区| 亚洲成人精品一区| 午夜欧美大尺度福利影院在线看| 国产精品日产欧美久久久久| 久久精品视频在线免费观看| 精品国产伦理网| 欧美日韩中文另类| 欧美性色黄大片手机版| 91美女视频网站| 99精品欧美一区| 成人高清伦理免费影院在线观看| 国产综合久久久久久久久久久久| 美女脱光内衣内裤视频久久网站 | 亚洲1区2区3区视频| 亚洲免费观看高清完整版在线观看| 亚洲色图丝袜美腿| 亚洲少妇中出一区| ㊣最新国产の精品bt伙计久久| 国产精品传媒入口麻豆| 亚洲在线视频免费观看| 亚洲福利视频一区二区| 五月激情综合婷婷| 美国欧美日韩国产在线播放| 丁香六月综合激情| av电影在线观看一区| 成人深夜福利app| 国产一区二区不卡老阿姨| 成人黄色小视频在线观看| 91浏览器在线视频| 91在线观看下载| 色偷偷成人一区二区三区91| 91啪亚洲精品| 欧美日韩专区在线| 久久蜜桃av一区精品变态类天堂 | 精品系列免费在线观看| 国产在线精品免费| 成人午夜电影小说| 欧美精品vⅰdeose4hd| 日韩欧美色电影| 欧美激情在线观看视频免费| 国产精品久久久久一区二区三区 | 亚洲久草在线视频| 亚洲综合一区二区| 久久 天天综合| 国模一区二区三区白浆| 日本国产一区二区| 日韩精品一区二区三区中文精品|