Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040
Recursive Descent Parser in C | Resources

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040
Home Resources Recursive Descent Parser in C

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 346

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 347

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 348

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 346

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 347

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 348

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 346

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 347

Deprecated: Function eregi_replace() is deprecated in /home/gabotr/public_html/plugins/content/ChronoComments.php on line 348

Recursive Descent Parser in C

The recursive descent parser is the core module of the calculator application found on the COMA, the XMultiKit and the Xmegalab. It is based on the Visual Basic program Math Expression Evaluator by Michael Combs.

I ported the code to standard C so it can be used on any platform.

To use this module you only need to add parse.c to your project and #include "parse.h" in your code.

Two global variables are used:

extern uint8_t m_error; // different than zero if an error occurred
extern double ans;      // answer

The only function you need to call is

void evaluate(char expression[]); // the expression must end with a space

The function will modify the global variables m_error and ans.

Example:

evaluate("1+1 "); // The expresion must and with a space

ans will equal 2, m_error will equal 0.

 

Download the files here:

cfile Recursive Descent Parser

Here is a calculator demo using the recursive descent parser:

Comments

avatar yonghui
Hi,

thanks very much for the fixed link.


thanks®ards,
inghui
avatar Borrisholt
HI

evaluate("1*-1");

Will make the parser break down.

JEns Borrisholt
avatar ganzziani
Hi Jens, did you add the space after the expression?
Please login to post comments or replies.
Last Updated on Monday, 11 April 2011 11:42  

Search

Products

Articles


Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Latest News


Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Archived


Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/components/com_sh404sef/sef_ext/com_content.php on line 40

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/components/com_sh404sef/sef_ext/com_content.php on line 40

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/components/com_sh404sef/sef_ext/com_content.php on line 40

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/components/com_sh404sef/sef_ext/com_content.php on line 40

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/components/com_sh404sef/sef_ext/com_content.php on line 40

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/components/com_sh404sef/sef_ext/com_content.php on line 40

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/components/com_sh404sef/sef_ext/com_content.php on line 40

Login


Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3039

Deprecated: Function eregi() is deprecated in /home/gabotr/public_html/administrator/components/com_sh404sef/sh404sef.class.php on line 3040





Shopping Cart

Your Cart is currently empty.

Featured Products

XMEGA Xprotolab
XMEGA Xprotolab
$49.00

Testimonials

Absolutely WONDERFUL. I'll buy a COMA when they are ready. You should too!
- flashautomation
Official PayPal Seal
credit-cards