• Post Reply Bookmark Topic Watch Topic
  • New Topic

Scanners and Parsers  RSS feed

 
Niels Anderson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

Below is an assignment that I have no clue what to do with or where to start.

I am pretty new to Java.

Can somebody, please help me out?

=========

we will use Coco/R to generate the scanner and the parser automatically:



Write a grammar for the same LAQL using Coco/R (/usr/common/coco-r at the institute or http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/), and use the generated scanner and parser to execute the queries in your library application.
Use semantic attributes in the LAQL grammar in order to collect the information specific to each query. You are not allowed to use global variables or modify the Parser generated sources.

Pay attention that recursive descent parsing require that the grammar satisfies the LL(1) property; this means that at any point in the grammar the parser must be able to decide on the basis of a single lookahead symbol which alternative to select. Coco/R checks if the grammar satisfies the LL(1) property and gives error messages if appropriate.
[ May 10, 2006: Message edited by: Neo Matrix ]
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How much have you written?
 
Niels Anderson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be honest with you, nothing.

I am just being helpless here.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well if 'The One' can't answer the question, I doubt if we mere mortals will be able to help.
 
Niels Anderson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joanne Neal:
Well if 'The One' can't answer the question, I doubt if we mere mortals will be able to help.


'The One' is nothing without his crew.

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first thing to do is to learn the syntax Coco/R uses to describe the LAQL language, whatever that is.

Then you can run Coco/R to create Java classes for the scanner and parser, which you can use in your "library application" for whatever that is supposed to do.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Neo Anderson",

I'm not sure you read our naming policy on the way in. In part, it states that "Obviously fictitious names may be locked out.".

I'd suggest you go here and update your display name.

thanks
 
Niels Anderson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
The first thing to do is to learn the syntax Coco/R uses to describe the LAQL language, whatever that is.

Then you can run Coco/R to create Java classes for the scanner and parser, which you can use in your "library application" for whatever that is supposed to do.


If only, if only, I knew how to do that.



fred, point well noted...sorry for overlooking the naming policy.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Niels Anderson:

If only, if only, I knew how to do that.


I think it's time to either:
1. Find an online COCO/PUFFS^H^H^H^HR forum.
2. Grovel to your prof/TA for some help.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Niels Anderson:

If only, if only, I knew how to do that.


Well, you gotta do a bit of research. The link you posted has the download for the Coco/R Java version, it links to documentation about the syntax of the grammar file, and it has examples. So there are plenty of starting points to choose from.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!