<?php
// Set MIME type for XML grammar fomat
header('Content-type: application/grammar+xml');
//Include base class
require ('grammar.php');
/*
This example makes calls to methods in the base grammar class to create a simple XML grammar file
*/
// Create new grammar object and call appropriate methods from base class
$page = new grammar;
$page->gramStart();
$page->ruleStart();
$page->oneOfstart();
$page->itemStart();
echo "one";
$page->itemEnd();
$page->itemStart();
echo "two";
$page->itemEnd();
$page->itemStart();
echo "three";
$page->itemEnd();
$page->oneOfend();
$page->ruleEnd();
$page->gramEnd();
?>
|