|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.upb.hni.vmagic.expression.parser.ExpressionParser
public class ExpressionParser
VHDL expression parser. The expression parser is a versatile utility to easily create complex VHDL expressions. Without it you would need to create an expression by manually creating a hierarchy of meta class objects. The expression parser simplifies this task by providing a printf like interface for creating expressions.
The expression template is a VHDL expression with placeholdes, which get replaced by the objects
in the paramter list. The syntax of the placeholders is %i
, where i
is
the index of the object that should be inserted at the placeholdes position. The index of the
first paramter is 1.
(10 + 20) * 30
Expression e = ExpressionParser.parse("(10 + 20) * 30");
(s1 AND "01100100") OR (s1 xor s2)
Signal s1 = new Signal("s1", StdLogic1164.STD_LOGIC_VECTOR(8)); Signal s2 = new Signal("s2", StdLogic1164.STD_LOGIC_VECTOR(8)); Expression e = ExpressionParser.parse("(%1 and \"01100100\") or (%1 xor %2)", s1, s2);
Method Summary | |
---|---|
static Expression |
parse(java.lang.String template,
Expression... parameters)
Parses the expression template. |
static Expression |
parse(java.lang.String template,
java.util.List<Expression> parameters)
Parses the expression template. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Expression parse(java.lang.String template, Expression... parameters)
template
- the templateparameters
- a list of expressions used as parameters
public static Expression parse(java.lang.String template, java.util.List<Expression> parameters)
template
- the templateparameters
- a list of expressions used as parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |