开发者

Parser generator for JavaME

开发者 https://www.devze.com 2023-01-02 15:44 出处:网络
First: I have looked at this SO question but unfortunately there is no mention of JavaME I am looking for a parser/lexer generator that produces code that can run on the Blackberry and its (obnoxious

First: I have looked at this SO question but unfortunately there is no mention of JavaME

I am looking for a parser/lexer generator that produces code that can run on the Blackberry and its (obnoxious) JavaME.

E.g. at first I thought I could use ANTLR however it seems the run-time library is not comp开发者_C百科atible with JavaME

TIA


It seems it was not that much work to adapt the ANTLR 3.2 run-time for JavaMe, I left out some things but ported most of the sources. It took about a day to rewrite for those who are facing the same problem.

Changes included:

  • replacing List/ArrayList with Vector
  • replacing Map/Hashmap with Hashtable
  • removing file handling (not needed -in my case)
  • removing cloneable (not supported)
  • removing all generics, replaced with normal, concrete classes
  • adding simple function to do string replaceAll
  • removed debugging module (not needed -in my case)
0

精彩评论

暂无评论...
验证码 换一张
取 消