Prolog Parser Implementation

 
 

Share on Google+Share on Google+

stephen lonergan
Prolog Parser Implementation
0 Answer(s)      5 years and 2 months ago
Posted in : Regex
Ads

Hi I am trying to implement a parser for a simple language with grammar like this.

program ::= "program" declarations "begin" statements "end"

declaration ::= "var" ident "as" type

type ::= "string" | "int"

I have the first two done, how would I write the type grammar?

program( prog( DECLS, STATS ) ) --> [ 'program' ], declarations( DECLS ), [ 'begin' ], statements( STATS ), [ 'end' ].

declaration( decl( IDENT, TYPE ) ) --> [ 'var' ], ident( IDENT ), [ 'as' ], type( TYPE ).

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
Prolog Parser Implementation
Prolog Parser Implementation  Hi I am trying to implement a parser for a simple language with grammar like this. program ::= "program" declarations "begin" statements "end" declaration ::= "var" ident "as" type type
Version of com.thesett>prolog dependency
List of Version of com.thesett>prolog dependency
Advertisements
Version of com.thesett>wam_prolog dependency
List of Version of com.thesett>wam_prolog dependency
Maven Dependency prolog >> 0.8.4
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.4 in your project
Maven Dependency prolog >> 0.8.19
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.19 in your project
Maven Dependency prolog >> 0.8.9
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.9 in your project
Maven Dependency prolog >> 0.8.13
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.13 in your project
Maven Dependency prolog >> 0.8.3
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.3 in your project
Maven Dependency prolog >> 0.8.21
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.21 in your project
Maven Dependency prolog >> 0.9.77
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.9.77 in your project
Maven Dependency prolog >> 0.9.97
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.9.97 in your project
Maven Dependency prolog >> 0.8.7
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.7 in your project
Maven Dependency prolog >> 0.8.17
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.17 in your project
Maven Dependency prolog >> 0.8.10
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.10 in your project
Maven Dependency prolog >> 0.9.117
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.9.117 in your project
Maven Dependency prolog >> 0.8.22
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.22 in your project
Maven Dependency prolog >> 0.8.12
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.12 in your project
Maven Dependency prolog >> 0.8.2
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.2 in your project
Maven Dependency prolog >> 0.8.18
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.18 in your project
Maven Dependency prolog >> 0.8.8
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.8 in your project
Maven Dependency prolog >> 0.8.20
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.20 in your project
Maven Dependency prolog >> 0.8-M1
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8-M1 in your project
Maven Dependency prolog >> 0.8.15
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.15 in your project
Maven Dependency prolog >> 0.8.5
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.5 in your project
Maven Dependency prolog >> 0.8.1
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.1 in your project
Maven Dependency prolog >> 0.8.11
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.11 in your project
Maven Dependency prolog >> 0.8.6
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.6 in your project
Maven Dependency prolog >> 0.8.16
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> prolog version0.8.16 in your project
VoIP Implementation
VoIP Implementation VoIP Implementation Tour We?re packing our... is launching the Voice on VOIP Implementation Tour 2004-one-day workshops...-telephony is essentially a non-starter.    VoIP Implementation
parser - XML
parser  how to convert XML file to flat file(text file) using DOM and SAX parser
Maven Dependency wam_prolog >> 0.8.21
You should include the dependency code given in this page to add Maven Dependency of com.thesett >> wam_prolog version0.8.21 in your project

Ads

 
Advertisement null

Ads