Re: Simple math parser ?

Discussion in 'C Programming' started by support@bestcode.com, Jan 13, 2014.

  1. Guest

    If you can use C++, then there is bcParserCPP. There are formula parsers for many languages at http://www.mathparsers.com/ C++, Java, Objective C, C#,Delphi, COM (vb 6 anyone?) are all covered by a suite of math parser libraries. Most of them support strictly mathematical formulas in the expressionto parse. C# version supports strings in the expression as well. Users candefine their own variables and user defined functions to use in the expressions.


    On Wednesday, February 4, 2009 6:56:23 AM UTC-8, Guillaume Dargaud wrote:
    > Hello all,
    > I need to do some simple math parsing from a C program and although that's
    > the kind of thing we all did in computer science courses, I have better
    > things to do now than to reinvent the wheel... I'm sure there's plenty of
    > similar code around but I see only a few passing mentions in the group (and
    > the links are no longer valid).
    >
    > So I have a list of variables in memory, and their types (double, integer,
    > bool) and I want the user to be able to enter a formula in a text box and
    > get the result or a syntax/math error.
    >
    > I don't need anything fancy: +-*/ operators, logical operators, numerical
    > constants, double/int/bool variables, parenthesis or reverse polish,
    > possibly the usual math functions (sin, log...). And I need stdC source....
    >
    > Any suggestions ? Google finds tons of irrelevant links.
    > I'm not familiar with Yacc/Bison/Lex, but I know they can generate C froma
    > grammar. But can they interface with a list of variables ?
    > --
    > Guillaume Dargaud
    > http://www.gdargaud.net/
    , Jan 13, 2014
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chirs
    Replies:
    18
    Views:
    750
    Chris Uppal
    Mar 2, 2004
  2. AciD_X
    Replies:
    4
    Views:
    8,075
    Jonathan Turkanis
    Apr 1, 2004
  3. Ben Pfaff

    Re: Simple math parser ?

    Ben Pfaff, Feb 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    409
    Chris McDonald
    Feb 4, 2009
  4. Bart

    Re: Simple math parser ?

    Bart, Feb 4, 2009, in forum: C Programming
    Replies:
    0
    Views:
    492
  5. VK
    Replies:
    15
    Views:
    1,130
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page