Class CipExpression
- java.lang.Object
-
- com.automation_pros.odva.cip.path.CipExpression
-
- Direct Known Subclasses:
CipExpression.BinaryOp
,CipExpression.Constant
,CipExpression.TrinaryOp
,CipExpression.UnaryOp
,CipExpression.Variable
public abstract class CipExpression extends java.lang.Object
Support expressions composed of variables, constants, and common operators, where variables are parsable CipPaths, and operators are applied in postfix (aka Reverse Polish Notation) order.Commas and whitespace push a preceding item onto the execution stack. Numeric constants are introduced with the pound sign (aka "hash").
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CipExpression.AddOp
static class
CipExpression.AndOp
static class
CipExpression.BinaryOp
static class
CipExpression.BitwiseOp
static class
CipExpression.CompareOp
static class
CipExpression.Constant
static class
CipExpression.DivideOp
static class
CipExpression.InvertOp
static class
CipExpression.LogicalAndOp
static class
CipExpression.LogicalOrOp
static class
CipExpression.MathOp
static class
CipExpression.ModulusOp
static class
CipExpression.MultiplyOp
static class
CipExpression.NotOp
static class
CipExpression.OrOp
static class
CipExpression.SubtractOp
static class
CipExpression.TrinaryOp
static class
CipExpression.UnaryOp
static class
CipExpression.Variable
static class
CipExpression.XorOp
-
Constructor Summary
Constructors Modifier Constructor Description protected
CipExpression()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static long
as64(BaseDataType<?> data)
static boolean
asBool(BaseDataType<?> data)
abstract BaseDataType<?>
execute(DataContext ctx)
abstract java.util.List<CipPath>
getVariablePaths()
protected static boolean
hasTrail(java.io.StreamTokenizer st, int trail)
static void
main(java.lang.String[] args)
static CipExpression
parse(java.lang.String expression)
protected abstract java.lang.String
prefixedString(java.lang.String prefix)
java.lang.String
toString()
-
-
-
Method Detail
-
execute
public abstract BaseDataType<?> execute(DataContext ctx)
-
hasTrail
protected static boolean hasTrail(java.io.StreamTokenizer st, int trail)
-
parse
public static CipExpression parse(java.lang.String expression)
-
asBool
public static boolean asBool(BaseDataType<?> data)
-
as64
public static long as64(BaseDataType<?> data)
-
getVariablePaths
public abstract java.util.List<CipPath> getVariablePaths()
-
prefixedString
protected abstract java.lang.String prefixedString(java.lang.String prefix)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
main
public static void main(java.lang.String[] args)
-
-