M
Max
Hello everyone!
I'm writing a simple xml parser with Javascript, but i have some problems
matching markupdecl because of elementdecl
markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI |
Comment
elementdecl is not a regular expression because of its circular procedure:
children ::= (choice | seq) ('?' | '*' | '+')?
cp ::= (Name | choice | seq) ('?' | '*' | '+')?
choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
elementdecl -> contentspec -> children -> choice | seq -> cp -> choice | seq
etc.
Since elementdecl is not a regular expression, markupdecl cannot be either
How to resolve the definitions of choice, seq and cp with regular
expression?
I have to match element without capture it.
Thanks,
Max
I'm writing a simple xml parser with Javascript, but i have some problems
matching markupdecl because of elementdecl
markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI |
Comment
elementdecl is not a regular expression because of its circular procedure:
children ::= (choice | seq) ('?' | '*' | '+')?
cp ::= (Name | choice | seq) ('?' | '*' | '+')?
choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
elementdecl -> contentspec -> children -> choice | seq -> cp -> choice | seq
etc.
Since elementdecl is not a regular expression, markupdecl cannot be either
How to resolve the definitions of choice, seq and cp with regular
expression?
I have to match element without capture it.
Thanks,
Max