Re: parser needed

From: Programmer Dude (Chris_at_Sonnack.com)
Date: 01/30/04


Date: Fri, 30 Jan 2004 14:27:18 -0600

Mahdiarnt wrote:

> In my program, I need a routin to turn the user input string of
> characters to a function. In fact the user is expected to write a
> mathematical function (of t, say) in an edit box and I want that
> function to be calculated for several arguments. So I need a parser.
> Is there any out there that I can copy in my source file? Or any other
> solution?
>
> I am writing it in Visual C++. The program itself is dialogue-based
> MFC, but that doesn't matter.

You're welcome to my code from when I went through Jack Crenshaw's
outstanding compiler tutorial. It's VC++ and comes in a compilable
project. This is "cc v2"--Crenshaw Compiler V2--and represents the
stage of the tutorial where he's got you compiling expressions and
assignments. It emits x86 assembly, but with a little tweaking is
probably exactly what you want.

        http://www.Sonnack.com/WillCall/ccv2.zip

-- 
|_ CJSonnack <Chris@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL  |
|_____________________________________________|_______________________|


Relevant Pages

  • Re: parser needed
    ... Mahdiarnt wrote: ... > characters to a function. ... in an edit box and I want that ...
    (comp.programming)
  • Re: parser needed
    ... mahdiarnt@yahoo.com writes: ... > characters to a function. ... in an edit box and I want that ...
    (comp.programming)
  • Re: Fortran source of non-linear unconstrained optimization
    ... I think that treating upper and lower case as ... machine-dependent mapping of upper or lower case characters to the ... "This standard does not specify: ... if a fortran compiler treats upper and ...
    (comp.lang.fortran)
  • Re: Reading GIF
    ... around that lets the programmer deal with a data type that Fortran ... signed integers than as characters. ... In theory, a compiler might not ... support 8-bit signed integers either, ...
    (comp.lang.fortran)
  • Re: Benchmark results (Re: Storage of char in 64 bit machine)
    ... here are some benchmarks comparing the use of strcmp() to compare ... short character strings (4 characters). ... in real world code regardless of how good the compiler is. ... These "authorities" are overstepping their bounds. ...
    (comp.lang.c)