All Downloads are FREE. Search and download functionalities are using the official Maven repository.

msv.tahiti.src.com.sun.tahiti.runtime.ll.DefaultNonTerminalSymbol Maven / Gradle / Ivy

The newest version!
/*
 * @(#)$Id: DefaultNonTerminalSymbol.java 996 2001-07-31 01:19:21Z Bear $
 *
 * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the proprietary information of Sun Microsystems, Inc.  
 * Use is subject to license terms.
 * 
 */
package com.sun.tahiti.runtime.ll;

import com.sun.msv.datatype.DatabindableDatatype;
import org.relaxng.datatype.ValidationContext;

/**
 * base class of the non-terminal symbols of LL grammar.
 * 
 * @author
 *	Kohsuke KAWAGUCHI
 */
public class DefaultNonTerminalSymbol extends NonTerminalSymbol {
	
	public DefaultNonTerminalSymbol( String symbolName ) {
		this.symbolName = symbolName;
	}
	
	private final String symbolName;
	
	public LLParser.Receiver createReceiver( final LLParser.Receiver parent ) {
		return new LLParser.CharacterReceiver(){
			public void action(DatabindableDatatype dt, String literal, ValidationContext context ) throws Exception {
				((LLParser.ObjectReceiver)parent).action(
					dt.createJavaObject(literal,context) );
			}
			public void start() throws Exception {}
			public void end() throws Exception {}
		};
	}
	
	public String toString() { return symbolName; }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy