由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Design thought.. Sugguestions?
相关主题
Introducting a better way of pattern handlingspring Annotation based configuration
有什么用java写的C parser/lexer吗?现在有些迷惑了
Do you guys use lex to parsing input?zookeeper
@Override annotation.Java Play Framework 和 Spring 比较一下? (转载)
[ZT] choose your java xml parserJava Server Faces
请教:parse CSV文件一个想不明白的编码问题
math expressionSOAP over SMTP
annotation questionObject比较
相关话题的讨论汇总
话题: expr话题: lexer话题: design话题: za话题: java
进入Java版参与讨论
1 (共1页)
c*****t
发帖数: 1879
1
This is a long post...
I am trying to update CookCC (a lexer / parser generator in Java) for
a new feature.
One existing CookCC feature is that one can specify the lexer pattern
and parser grammar in Java annotations. For example:
@CookCCOption
class MyParser extends GeneratedParser
{
@Lex (pattern = "[_A-Za-z][_A-Za-z0-9]*", state = "INITIAL")
String scanIdentifier ()
{
return yyText ();
}
@Rules (rules = {
@Rule (lhs = "Expr", rhs = "Expr '+' Expr"),
m******t
发帖数: 2416
2
I finished reading the long post, but this stuff is so specialized that
the only question I can come up with is - how did you manage the
indentation in these code snippets?

【在 c*****t 的大作中提到】
: This is a long post...
: I am trying to update CookCC (a lexer / parser generator in Java) for
: a new feature.
: One existing CookCC feature is that one can specify the lexer pattern
: and parser grammar in Java annotations. For example:
: @CookCCOption
: class MyParser extends GeneratedParser
: {
: @Lex (pattern = "[_A-Za-z][_A-Za-z0-9]*", state = "INITIAL")
: String scanIdentifier ()

A**o
发帖数: 1550
3
lol. returned all my compiler knowledge to my teacher already. //blush

【在 m******t 的大作中提到】
: I finished reading the long post, but this stuff is so specialized that
: the only question I can come up with is - how did you manage the
: indentation in these code snippets?

c*****t
发帖数: 1879
4
I just typed it in the terminal.
Kinda stuck for the project.
c*****t
发帖数: 1879
5
这个问题并不是在问 compiler 的问题啊。问的是 design 类的问题。
也就是说,有 N 个 interface / impl,因为某个原因,其中的 impl 需要
call 某个 class (generated)的一系列 function (lexer functions),
问的是,如何简单有效的将这些 impl 和该 class 联系起来,尽量减少
impl 得写的部分。

【在 A**o 的大作中提到】
: lol. returned all my compiler knowledge to my teacher already. //blush
1 (共1页)
进入Java版参与讨论
相关主题
Object比较[ZT] choose your java xml parser
一道 JAVA Stack vs Heap 题请教:parse CSV文件
The best HashMap Cache solutionmath expression
interesting "protect" behaviorannotation question
Introducting a better way of pattern handlingspring Annotation based configuration
有什么用java写的C parser/lexer吗?现在有些迷惑了
Do you guys use lex to parsing input?zookeeper
@Override annotation.Java Play Framework 和 Spring 比较一下? (转载)
相关话题的讨论汇总
话题: expr话题: lexer话题: design话题: za话题: java