Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8621311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:47:31+00:00 2026-06-12T06:47:31+00:00

I am new to context free grammar and i’ve only learned stuff like left/rightmost

  • 0

I am new to context free grammar and i’ve only learned stuff like left/rightmost derivation and G=(V, E, R ,S) so far. But the problem I’m trying to solve involves java prototype and I’m not very good at java. So I don’t really know where to start.

Give a context-free grammar for the sub-language of Java prototypes.

int myMethod();
double myMethod(int x, double y);
static double f(int x, double y, int z);
public static double g();

These are methods and variables, how can I relate to things like S => Sa | e ? And what is the start symbol?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:47:33+00:00Added an answer on June 12, 2026 at 6:47 am

    All java you need to know about method signatures is located on single doc page. You start writing grammar by identifying grammar variables. The obvious ones to start with are

    - type
    - argument_name
    - method_name
    - parenthesis (2 terminal symbols)
    - comma (terminal)
    - semicolon (terminal)
    

    You introduce more variables while writing grammar rules, for example

    argument_list : argument
                  | argument, comma, argument_list
    

    As soon as you finish your grammar you’d have the “top most rule”:

    method_signature : ... 
    

    The method_signature is the start symbol.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Typically you start a service like this Intent i = new Intent(context,MessageService.class); context.startService(i); but
I'd like to parse a CSV using context free grammar. I arleady have an
How to define a grammar (context-free) for a new programming language (imperative programming language)
Code like this works well. Intent configIntent = new Intent (context, WidgetConfigActivity.class); configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
I have the following code. but it causes exception. using (var context = new
I'm reading a file containing context free grammar and tokenizing each line and generating
I'm trying to parse user-inputted prefix notation logical expressions using a context-free-grammar with the
So I have this linq query clause. var ctx = new Context(); IQueryable<Users> consulta
I'm trying to do this: using(var context = new SampleEntities()) { User user =
I have following code: //preparing DAO objects FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(test-context.xml); surveyDao =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.