ReadExp
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:A small library to help with mathematical expression parsing.
* Read Exp(ression)
  ReadExp is a small library to help with the parsing of mathematical
  expressions. Currently it only skips spaces, reads numbers and any
  other symbol it encounters, categorizes as operator. Single
  precision floating point and arbitrary bases with the syntax
  `bb#nn[.ff]` is suported. Note that this only uses string.h so it
  can work on embeded systems with little to no effort. Also the
  library is designed to be fed the characters one by one and return
  results in real time.

** Usage notes
   Use `getOp(char)` to feed the library characters of the expression
   one by one and returns a `struct symbol`:


   #+BEGIN_SRC C
   struct symbol {
    unsigned type;
    char cval;
    int ival;
    float fval;
   };
   #+END_SRC

   and for `type` the flags `NUMBER`, `FLOAT`, `OPERATOR` and
   `INVALID` are defined. Depending on the value of type the
   corresponding member is valid. getOp returns one by one the symbols
   it finds. `burstOp` has the exact same syntax only it may return a
   symbol that contains both a number and an operator.


** Building

   Just run `cmake .` and `make` and then you have full access to the library via
   the header and the .a file.

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。