Results 1 to 3 of 3

Thread: Parsing Algorithm

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Philippines
    Posts
    2

    Question Parsing Algorithm

    I'm currently making a very powerful graphing program that can calculate and graph any mathematical expression:

    Algebra (except complex numbers), Trigonometry (sin, cos, tan, csc, sec, cot, arccos, arcsin), Analytic Geometry(Conic Sections), Calculus(Piecewise defined functions, Greatest Integer Functions (step functions), Absolute Value Functions)

    I'm currently having trouble in making this program because I dont know how to parse correctly (I'm making a program that uses keywords and objects to create the graph).

    List of Methods:

    Ellipse(X,Y,A,B), Color= RGB(xxx,xxx,xxx);
    Circle(X,Y,R), Color=RGB(xxx,xxx,xxx);
    Hyperbola(X,Y,A,B), Color=RGB(xxx,xxx,xxx);
    Parabola(X,Y, P, Opens), Color=RGB(xxx,xxx,xxx);

    List of Functions:

    sin
    cos
    tan
    csc
    sec
    cot
    arcsin
    arccos
    arctan
    int - Greatest integer function
    abs - absolute value
    DER - Derivation (Not Accomplished yet, need help on this)
    (all of this is in a text file format, needs to be interpreted)
    more.........
    K Otake

  2. #2
    jim mcnamara
    Guest
    Use a descending parser.

    It looks for tokens (keywords) then figures out how to translate the keyword argument into something the program can do. There is a descending parser in the attached code.

    I've messed with creating an interactive version of C, written in C.
    You can play with the attached code - snot.c (short for 'It's not C')

  3. #3
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Dan

    Outside of a dog, a book is a man's best friend.
    Inside of a dog, it's too dark to read.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width