2
J'utilise ce BNF pour parser mon script: `BNF pour gérer la séquence d'échappement
{identset} = {ASCII} - {"\{\}}; //<--all ascii charset except '\"' '{' and '}'
{strset} = {ASCII} - {"};
ident = {identset}*;
str = {strset}*;
node ::= ident "{" nodes "}" | //<--entry point
"\"" str "\"" |
ident;
nodes ::= node nodes |
node;
`
il peut analyser correctement le texte suivant dans l'arborescence `
doc {
title { "some title goes here" }
refcode { "SDS-1" }
rev { "1.0" }
revdate { "04062010" }
body {
"this is the body of the document
all text should go here"
chapter { "some inline section" }
"text again"
}
}
`
ma question est, Comment gérer séquence d'échappement dans la chaîne littérale: `
"some text of \"quotation\" should escape"
`
Est-ce devoir? –
non ce n'est pas les devoirs. – uray