Its working. Sam you were right all I needed to compile was Antlr.Runtime.



I needed to make a few changed to get it to compile for the CF. In case someone 
else wants to do this in the future here is what I did

* Created a new CF project and added all the existing .cs files 

* Add "DOTNET2" to the defines

* In AssemblyInfo.cs: Comment out AllowPartiallyTrustedCallers

* In Stats.cs: Replace call to Environment.GetCurrentPath with 
Asm.GetExecutingAssembly().GetName().CodeBase

* In ErrorManager.cs: Remove all references to StackTrace and StackFrame. It 
should be possible to get the required information from looking at the 
Exception parameter's StackTrace property and parsing the string. However I've 
just set the location to an empty string for now. (Fortunately for me, error 
handeling is not too important in my DSL)

* In TokenRewriteStream.cs: Replace call to Array.GetRange with a call to a 
custom method that does what GetRange does.

* In BaseRecogniser.cs: Throw a NotImplementedException in 
GetRuleInvocationStack(). Again it should be possible to parse the stack trace 
string but I'm not using this method so I'm just throwing.


All in all it was pretty simple to get working. 



-----Original Message-----
From: Sam Harwell [mailto:[email protected]] 
Sent: 14 September 2009 16:49
To: André van der Merwe; [email protected]
Subject: RE: [antlr-interest] ANTLR on Microsoft's Compact Framework?

Are you trying to run a generated parser, or are you actually trying to run 
Antlr3.exe on the CF to generate your parser?

If you only want to run the generated parser, then you probably only need to 
compile Antlr3.Runtime.dll (CSharp3 target) or Antlr.Runtime.dll 
(CSharp/CSharp2 target).

Sam

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of André van der Merwe
Sent: Sunday, September 13, 2009 4:05 PM
To: [email protected]
Subject: [antlr-interest] ANTLR on Microsoft's Compact Framework?

Hi,

Has anyone managed to get an ANTLR generated parser (C#) working on the .net 
compact framework?

I doubt there are any major issues with the generated code but the references 
are going to be a problem. Before I go and recompile everything for the CF I 
wanted to check if there were known issues or perhaps someone has already done 
this?



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to