Lines Matching defs:dom
75 $dom = ebnf_parse_syntax($tokens);
78 echo $dom->saveXML();
80 render_node($dom->firstChild, true);
84 $dom = new DOMDocument();
85 $syntax = $dom->createElement("syntax");
88 $dom->appendChild($syntax);
89 render_node($dom->firstChild, true);
279 $dom = new DOMDocument();
280 $syntax = $dom->createElement("syntax");
282 $dom->appendChild($syntax);
293 $syntax->appendChild(ebnf_parse_production($dom, $tokens, $i));
304 return $dom;
307 function ebnf_parse_production(&$dom, &$tokens, &$i) {
311 $production = $dom->createElement("rule");
316 $production->appendChild( ebnf_parse_expression($dom, $tokens, $i));
324 function ebnf_parse_expression(&$dom, &$tokens, &$i) {
325 $choise = $dom->createElement("choise");
326 $choise->appendChild(ebnf_parse_term($dom, $tokens, $i));
330 $choise->appendChild(ebnf_parse_term($dom, $tokens, $i));
335 function ebnf_parse_term(&$dom, &$tokens, &$i) {
336 $sequence = $dom->createElement("sequence");
337 $factor = ebnf_parse_factor($dom, $tokens, $i);
342 $sequence->appendChild(ebnf_parse_factor($dom, $tokens, $i));
347 function ebnf_parse_factor(&$dom, &$tokens, &$i) {
350 $identifier = $dom->createElement("identifier");
354 $literal = $dom->createElement("terminal");
358 $expression = ebnf_parse_expression($dom, $tokens, $i);
364 $option = $dom->createElement("option");
365 $option->appendChild(ebnf_parse_expression($dom, $tokens, $i));
371 $loop = $dom->createElement("loop");
372 $loop->appendChild(ebnf_parse_expression($dom, $tokens, $i));