Package com.sun.msv.grammar

Examples of com.sun.msv.grammar.Grammar


        } catch( ValidityViolation vv ) {
            System.out.println(vv.getMessage());
            return null;
        }
       
        Grammar grammar = getGrammarFromReader(reader,file);
       
        if( grammar==null )    return null;
        else                return new ISchemaImpl( grammar );
    }
View Full Code Here


   
   
    public Schema compileSchema( InputSource source )
        throws VerifierConfigurationException, SAXException {
        try {
            Grammar g = parse(source,new ThrowController());
            if(g==null)
                // theoretically this isn't possible because we throw an exception
                // if an error happens.
                throw new VerifierConfigurationException("unable to parse the schema");
            return new SchemaImpl(g,factory,usePanicMode);
View Full Code Here

    // parse schema
    //--------------------
        final long stime = System.currentTimeMillis();
        System.out.println( localize(MSG_START_PARSING_GRAMMAR) );

        Grammar grammar=null;
        try {
            GrammarLoader loader = new GrammarLoader();
           
            // set various parameters
            loader.setController( new DebugController(warning,false,entityResolver) );
View Full Code Here

    public Schema compileSchema(InputSource source)
        throws VerifierConfigurationException, SAXException, IOException {
       
        try {
            Grammar grammar = SRELAXNGReader.parse( source, factory, new ThrowController() );
            if(grammar==null)
                throw new VerifierConfigurationException("unable to parse schema:"+source.getSystemId());
            return new RelamesSchemaImpl(grammar);
        } catch( WrapperException e ) {
            throw e.e;  // re-throw
View Full Code Here

                new DebugController(false),
                spf,
                new ExpressionPool() );
           
            reader.parse(href);
            Grammar grammar = reader.getResultAsGrammar();
           
    //        // remember this association
    //        schema.put( context.getSourceTree(), new PSVIRecorder(grammar) );
   
            // run PSVI annotation
View Full Code Here

    }
       
    public ISchema parseSchema( InputSource source ) throws Exception {
        if( source==null )
            throw new Error("this source doesn't support the getAsInputSource method");
        Grammar g = parseSchema( source, createController() );
       
        if(g==null)        return null;
        else            return new ISchemaImpl(g);
    }
View Full Code Here

   
    System.out.println("parsing    "+args[0]);
    // parse a grammar
    SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance();
    factory.setNamespaceAware(true);
    Grammar grammar = SRELAXNGReader.parse( args[0], factory, new DebugController(false,false) );
    if(grammar==nullreturn;
   
    // setup verifier
    RelmesVerifier verifier = new RelmesVerifier(
      new REDocumentDeclaration(grammar), new ReportErrorHandler() );
View Full Code Here

    public Schema compileSchema(InputSource source)
        throws VerifierConfigurationException, SAXException, IOException {
       
        try {
            Grammar grammar = SRELAXNGReader.parse( source, factory, new ThrowController() );
            if(grammar==null)
                throw new VerifierConfigurationException("unable to parse schema:"+source.getSystemId());
            return new RelamesSchemaImpl(grammar);
        } catch( WrapperException e ) {
            throw e.e;  // re-throw
View Full Code Here

    // it is a good idea to use Xerces for parsing, too.
    SAXParserFactoryImpl factory = new SAXParserFactoryImpl();
    factory.setNamespaceAware(true);
   
    // load a grammar.
    Grammar g = GrammarLoader.loadSchema(
      args[0],
      new DebugController( false,false, System.err ),
      factory );
   
    if( g==null ) {
View Full Code Here

       
        SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setNamespaceAware(true);
        factory.setValidating(false);
       
        Grammar grammar;
       
        if( args[0].equals("trex") ) {
            TREXGrammarReader reader = new TREXGrammarReader(
                new com.sun.msv.driver.textui.DebugController(false,false),
                factory,
View Full Code Here

TOP

Related Classes of com.sun.msv.grammar.Grammar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.