C grammar for Javacc wanted!

Hi all,
I am very new at Javacc and having troubles with writing a parser and extracting some information from C source code.
I found C grammar for Javacc on http://www.cobase.cs.ucla.edu/pub/javacc/C.jj but it's giving a lot of errors. I fixed some of them but now i am stuck with the next one:
C:\>java -classpath . CParser c:\clips\analysis.c.prep
C Parser Version 0.1Alpha: Reading from file c:\clips\analysis.c.prep . . .
Exception in thread "main" java.lang.Error at CParser.<clinit>(CParser.java:3822)
Did anybody come across such an error before? Or can you give me any suggestion about it? Or where can i find a proper C grammar that will work fine with Javacc for my assignment?
Any help would be greatly appreciated!
Thanks,
Olia

Generalize.
A polynomial is a sum of monomials.
Now, how would you make a grammar for monomials? Once you have that, how would you make a grammar for a sum of monomials?

Similar Messages

  • Grammar for Boolean Equations

    Could anyone show me a grammar for boolean equation with 3 variables x,y.z
    that i could use to help build a parser.
    thanks
    podger

    Equation := '(' 'equal' Expression Expression ')';
    Expression := Var | AndEx | OrEx | NotEx;
    NotEx := '(' 'not' Expression ')';
    AndEx := '(' 'and' Expression+ ')';
    OrEx := '(' 'or' Expression+ ')';
    Var := 'x' | 'y' | 'z';
    is probably the easiest complete one to build a parser for; if you want some other language (eg infix operators) then you need a more complicated parser; essentially the grammar morphs to
    Equation := DisEx 'equal' DisEx;
    DisEx := DisTerm ( 'or' DisTerm) *;
    DisTerm := Var | ConEx | NotEx;
    Var := 'x' | 'y' | 'z';
    ConEx := ConTerm ( 'and' ConTerm ) +;
    ConTerm := ExTerm | '(' Expression ')';
    NotEx := 'not' ConTerm;
    Which is harder to write a parser for.

  • HT201541 Some sites(like youtube for instance) want me to update Safari but when I go to  Software Update under the apple it says there are no updates. What do I do now?

    Some sites(like youtube for instance) want me to update Safari but when I go to  Software Update under the apple it says there are no updates. What do I do now?

    Upgrade the computer’s OS, or switch to a product such as Firefox.
    To upgrade, open the Mac App Store and try downloading Yosemite. If you get told it's incompatible, choose About this Mac from the Apple menu, check if the computer has at least a Xeon or Core 2 Duo(not Core Duo) CPU and 2GB of RAM, and if it does, click here and order a download code for Lion 10.7.
    Back up your data and check your applications for compatibility before upgrading. In particular, Mac OS X 10.7 and newer don't support PowerPC programs such as versions of Microsoft Office prior to 2008.
    (125625)

  • Charged wrong amount for app want refund

    Charged wrong amount for app want refund

    Contact the AppStore Support, http://www.apple.com/support/mac/app-store/contact/
    See the section "Account and Billing Support" : https://expresslane.apple.com/Issues.action

  • Mcafee poped up telling me that Plugin Container for Firefox wants to access to the Internet, do I allow it or do I block it?

    Firefox seems to crash alot for me and when it does a window pops up telling me the problem is with my Plugin Container for firefox. I have uninstalled Firefox many times and than installed the new version. Well today my McAfee popped up and told me that the program Plugin Container for Firefox want to access the Internet. Either I can allow it, allow it once or block it. I do not know what I should do.

    Hi Sparks, use the search..:) http://support.mozilla.com/en-US/questions/713600

  • I have a package for photographers - want like to use the complete package

    I have a package for photographers - want like to use the complete package. How do I switch to the complete package at an affordable price?

    Upgrade single to all Cloud http://forums.adobe.com/thread/1235382 may help

  • Repeated requests for "librariand wants to use login keychain"

    I am frequently getting dialogue box requests for "librariand wants to use login keychain"....
    I understand this is an Apple process, apparently related to iCloud... but how many times does it need to interrupt me?! 
    There is no "check to remember" option.
    Any way to get it to cease?

    Librariand seems to be required by iCloud in combination with Evernote. Do you have Evernote installed?
    See this thread Re: Is "librariand" part of Lion ? if yes, what is it for ?https://discussions.apple.com/message/15932747#15932747

  • Hello How do I delete or disable the scrollbar. I use kiosk for fulscreem wants no scrollbar What should I do?

    hello
    How do I delete or disable the scrollbar.
    I use kiosk for fulscreem wants no scrollbar
    What should I do?

    I also already deleted my phone number from iMessage on my MBP.

  • Got white iphone 6 for christmas want the black 6.. is there a way to pay a small amount and get the phones swapped over?

    got white iphone 6 for christmas want the black 6.. is there a way to pay a small amount and get the phones swapped over? thanks

    Depending on where the iPhone was purchased, you may be able to
    return it for $/credit and then buy the color you prefer. If past the
    return window the seller allows, use a case like Briansyddall suggested above.

  • Purchased InDesign for Mac, want to use a PC

    If I already own InDesign CS6 for Mac, what are my options if I want to use it on a PC?  I use a Mac as my primary computer, but I have a powerful PC that I am interested in using as a backup.  I don't necessarily want to re-purchase my programs for it, though.

    With a perpetual license I think you could get a "cross-grade" to switch platforms, but only once, and it won't leave you any better off since you'd lose the Mac usability.

  • 2nd hand Mac Pro: what to look for? Want later models

    Hi everyone
    I have a 27" iMac tha tis a couple of years old. I have outgrown the 1tb hd, and would prefer to go for a standard desktop design to make adding and changing drives easier. I want to avoid obsolence. I am not looking for a very new model, but one that is a current design. Can anyone give tips on how to determine how recent used Mac Pros i come across are?
    Thanks in advance for any tips you can pass on!
    John

    Additional information for completeness:
    The 2008 model and previous are Very Different from the 2009 and later. The 2009 and later can accept much more memory and that memory is substantially cheaper. The 2009 and later with the same number and nominal speed of processors approaches twice as fast in benchmarks due to architectural differences
    So if you expect to do compute and memory intensive modeling, Photo, Video, or Audio editing, limit your hunt to the 2009 model and later.
    If you are doing general work that does not involve large memory sizes, any model Mac Pro will work for you.

  • Why does Reader for Android want access to my GMail?

    I was about to update Adobe Reader  on my Droid X just now and decided to review what changes were being  made to the application's permissions. Apparently now I would have to  "Allow this application to access: Your messages (read Gmail)"
    Why would Adobe Reader need access to my Gmail messages?

    This unexplained change in required privileges is totally unacceptable.
    I am only one of many who are posting in Market feedback that we will not update to this latest version until a reasonable explanation is given. 
    As with Apple's "LocationGate", a failure to communicate early, clearly and accurately will cause (is causing?) a major negative reaction among users. 
    Adobe needs to either give a credible reason for this change or roll out an update that doesn't require access to our Gmail. 
    A further reason to be concerned about this privilege request: they want to access Gmail, but make no request to access our other email accounts via "messaging".  Why just Gmail?  
    Update: their revised release note mentions access to standard email with this update, but still does not request permission to do so. This makes the Gmail privilege all that more suspicious. As for their claim this is needed to open PDF attachments, the prior version did this without Gmail access permission  
    In any case, I'm joining the update boycott until this is explained or removed. 
    Message was edited by: sylerner to improve formatting and add an update.

  • Developing JNI routines for Windows - want your suggestions

    Everyone:
    After seeing several questions over and over again about how to do certain things that can only be done (or at least best be done using JNI), I am taking the time to develop some java/c code to access native Windows functions from Java.
    Please make suggestions as to functions you wish you had through java but do not. Common requests are: reading environment variables, setting system time, date, getting mac address, etc. The more you ask for, the more the library will be able to do. Once it's working, I'll post the code here for anyone who wants it.
    Thanks.

    Updated list of jni functions now supported (descriptions are self explanatory):
    JNIEXPORT jstring JNICALL Java_Win32Native_sayHello (JNIEnv *env, jobject);
    JNIEXPORT void JNICALL Java_Win32Native_setSystemTime (JNIEnv *env, jobject obj, jshort hour, jshort minutes);
    JNIEXPORT jstring JNICALL Java_Win32Native_getMACAddress (JNIEnv *env, jobject obj);
    JNIEXPORT jlong JNICALL Java_Win32Native_createMutex (JNIEnv *env, jobject obj, jstring strMutexName);
    JNIEXPORT jlong JNICALL Java_Win32Native_getLastError (JNIEnv *env, jobject obj);
    JNIEXPORT jlong JNICALL Java_Win32Native_getErrorCode (JNIEnv *env, jobject obj);
    JNIEXPORT jboolean JNICALL Java_Win32Native_isRunning (JNIEnv *env, jobject obj, jstring strMutexName);
    JNIEXPORT jstring JNICALL Java_Win32Native_getWindowsDirectory (JNIEnv *env, jobject obj);
    JNIEXPORT jstring JNICALL Java_Win32Native_getSystemDirectory (JNIEnv *env, jobject obj);
    JNIEXPORT jstring JNICALL Java_Win32Native_expandEnvironmentStrings (JNIEnv *env, jobject obj,jstring strSource);
    JNIEXPORT void JNICALL Java_Win32Native_lockWorkstation (JNIEnv *env, jobject obj);
    JNIEXPORT jstring JNICALL Java_Win32Native_getFileTime (JNIEnv *env, jobject obj, jstring strFileName);
    JNIEXPORT jlong JNICALL Java_Win32Native_getTickCount (JNIEnv *env, jobject obj);
    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceFrequency (JNIEnv *env, jobject obj);
    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceCounter (JNIEnv *env, jobject obj);
    JNIEXPORT jint JNICALL Java_Win32Native_getHwnd(JNIEnv *env, jobject obj, jstring title);
    JNIEXPORT void JNICALL Java_Win32Native_setWindowAlwaysOnTop(JNIEnv *env, jclass obj, jint hwnd, jboolean flag);
    JNIEXPORT jstring JNICALL Java_Win32Native_getDriveType(JNIEnv *env, jclass obj, jstring strPath);
    JNIEXPORT jlong JNICALL Java_Win32Native_getDiskFreeSpace(JNIEnv *env, jclass obj, jstring strPath);
    JNIEXPORT jstring JNICALL Java_Win32Native_getEnvironmentVariable(JNIEnv *env, jclass obj, jstring strVariable);
    JNIEXPORT jboolean JNICALL Java_Win32Native_setEnvironmentVariable(JNIEnv *env, jclass obj, jstring strVariable, jstring strValue);
    JNIEXPORT void JNICALL Java_Win32Native_rebootPC (JNIEnv *env, jobject obj);
    JNIEXPORT jboolean JNICALL Java_Win32Native_moveFile(JNIEnv *env, jclass obj, jstring strSource, jstring strDestination);
    JNIEXPORT jboolean JNICALL Java_Win32Native_installFilters(JNIEnv *env, jclass obj, jint hInstance, jstring strTitle, jlong tmNow);
    JNIEXPORT jboolean JNICALL Java_Win32Native_killFilters(JNIEnv *env, jclass obj);
    JNIEXPORT jlong JNICALL Java_Win32Native_getCurrentTime(JNIEnv *env, jobject obj);
    JNIEXPORT jlong JNICALL Java_Win32Native_getHinstance(JNIEnv *env, jobject obj, jstring title);
    JNIEXPORT jint JNICALL Java_Win32Native_createProcess(JNIEnv *env, jobject obj, jint nMode, jstring cmdproc, jstring buff );
    JNIEXPORT jint JNICALL Java_Win32Native_createLink(JNIEnv *env, jobject obj, jstring strPathObj, jstring strPathLink, jstring strDesc );
    JNIEXPORT void JNICALL Java_Win32Native_launchDefaultBrowser(JNIEnv *env, jobject obj, jstring strURL );
    JNIEXPORT jboolean JNICALL Java_Win32Native_emptyBrowserCache(JNIEnv *env, jobject obj );
    JNIEXPORT jboolean JNICALL Java_Win32Native_sendFileToRecycleBin(JNIEnv *env, jobject obj, jstring strFilePath);
    Thanks to those who made suggestions. Certainly open to more ideas.

  • Display setting for KF wants to see -ve values as (KF)

    Hi,
    By defalut for a key figure  this is the setting for "Sign Change: Select whether +/- signs are to be kept or reversed. When a sign is reversed, a positive number is given a minus sign (for example, 85 becomes -85) and a negative number is given a plus sign (for example, -38 becomes +38)". But I want to have it in excel way where -ve KF is depicted by brackets.
    Any idea how to do it?
    Need help.

    Goto Query Properties. In the Display Tab you can see an option of displaying the negative value as ().
    Use this setting.

  • Sony Bridge for Mac wanted an update, and phone won't switch on now!

    Hello
    Today I was trying to transfer some files from my phone to my Mac. When I connected my phone the Sony Bridge for Mac has asked me if I would like to update so I clicked yes and it began updating, with my phone connected. Then out of sudden, my phone switched off and it won't switch back on. It will only vibrate and show the Sony logo but won't go any futher. I tried the combination of vol+ and on/off button and many others, but nothing works!! I need my phone very urgently at work, and I really don't want to loose any files!!! 
    Please help!
    Solved!
    Go to Solution.

    It sounds more like you had a system firmware update and you may have disconnected your phone as this process was happening - All you can do I'm afraid to say is a system repair but this will erase all data on your phone
    For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.   Richard P. Feynman

Maybe you are looking for