/*------------------------------------------------------------------*/ /* expr.h */ /*------------------------------------------------------------------*/ #ifndef EXPR_INCLUDED #define EXPR_INCLUDED enum ExprType {EXPR_NUMBER, EXPR_FLIPFLOPREF, EXPR_INPUTREF, EXPR_NOT, EXPR_AND, EXPR_OR}; typedef struct Expr *Expr_T; /* These functions are called by the Parser module: */ Expr_T Expr_newNumber(int iNumber); /* Return a new "number" Expr_T whose number is iNumber. It is a checked runtime error for iNumber to be anything but 0 or 1. */ Expr_T Expr_newInputRef(int iIndex); /* Return a new "input reference" Expr_T that references the Circuit input whose index is iIndex. It is a checked runtime error for iIndex to be negative. */ Expr_T Expr_newFlipFlopRef(int iIndex); /* Return a new "flip flop reference" Expr_T that references the Circuit flip flop whose index is iIndex. It is a checked runtime error for iIndex to be negative. */ Expr_T Expr_newNot(Expr_T oChild); /* Return a new "not" Expr_T whose subexpression is oChild. It is a checked runtime error for oChild to be NULL. */ Expr_T Expr_newAnd(Expr_T oLeftChild, Expr_T oRightChild); /* Return a new "and" Expr_T whose left subexpression is oLeftChild and whose right subexpression is oRightChild. It is a checked runtime error for oLeftChild or oRightChild to be NULL. */ Expr_T Expr_newOr(Expr_T oLeftChild, Expr_T oRightChild); /* Return a new "or" Expr_T whose left subexpression is oLeftChild and whose right subexpression is oRightChild. It is a checked runtime error for oLeftChild or oRightChild to be NULL. */ /* These functions are called by Circuit: */ /* You should determine. */ /* These functions are called by Simulator: */ /* You should determine. */ #endif