Version française
Home     About     Download     Resources     Contact us    
Browse thread
camlp4 grammar and LIST1
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Joel Reymont <joelr1@g...>
Subject: camlp4 grammar and LIST1
In the following bit of camlp4 grammar

   inputDeclarations:
   [
     [ "Input"; ":";
       l = LIST1 inputDeclaration SEP "," -> l
     ]
   ];

Is it always necessary to write [ x = inputDeclaration -> x ] instead  
of just inputDeclaration?

I'm trying to debug the type of each rule and I'm often getting  
complaints about 'unit list' being used instead of just 'statement'.

By the same token, can I shorten the gramar below to just  
[ openStatement | closedStatement ]?

   statement: [ [ s = openStatement -> s | s = closedStatement -> s ] ];

How do you folks debug grammar rule types?

	Thanks, Joel

---
http://tinyco.de
--- Mac & iPhone