C# 클래스 CSE.Exps.ArithExp

Used to parse arithmetic expressions
파일 보기 프로젝트 열기: kcherr1/CSharp-Eval 1 사용 예제들

비공개 메소드들

메소드 설명
Affirm ( CseObject obj ) : CseObject

Applies numeric affirmation (i.e. unary plus) to numeric values

Negate ( CseObject obj ) : CseObject

Applies numeric negation (i.e. unary minus) to numeric values

Parse ( CseObject leftOperand, CseObject rightOperand, ArithType arithType ) : CseObject

Parses arithmetic expressions

Only works with operands that evaluate to either numeric or string types. If both operands are strings and arithType is ADD, concatenation is performed. Else, if either operand is of a float type, both are treated as float type. Else, both are treated as int types. This is to ensure proper behavior of operators such as addition and division. If operands are of int type, result is then parsed as a literal expression to ensure correct return type.