/** eats string literal */ public final boolean onText2( String literal, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) { if(!super.onText2(literal,context,refErr,refType)) return false; final StringToken token = new StringToken(docDecl,literal,context); final ResidualCalculator res = docDecl.resCalc; // some may become invalid, but at least one always remain valid for( int i=0; i<contents.length; i++ ) contents[i] = res.calcResidual( contents[i], token ); return true; }
ResidualCalculator resCalc = new ResidualCalculator(reader.pool); if(!resCalc.calcResidual( exp.exp, token ).isEpsilonReducible() ) {
/** * creates an object that validates the specified expression. */ public REDocumentDeclaration( Expression topLevel, ExpressionPool pool ) { this.topLevel = topLevel; this.pool = pool; resCalc = new ResidualCalculator(pool); attFeeder = new AttributeFeeder(this); attPicker = new AttributePicker(pool); attPruner = new AttributePruner(pool); attRemover = new AttributeRemover(pool); cccec = new CombinedChildContentExpCreator(pool); ecc = new ElementsOfConcernCollector(); attToken = new AttributeToken(this,null,null,null,null); }
ResidualCalculator resCalc = new ResidualCalculator(reader.pool); if(!resCalc.calcResidual( exp.exp, token ).isEpsilonReducible() ) {
/** * creates an object that validates the specified expression. */ public REDocumentDeclaration( Expression topLevel, ExpressionPool pool ) { this.topLevel = topLevel; this.pool = pool; resCalc = new ResidualCalculator(pool); attFeeder = new AttributeFeeder(this); attPicker = new AttributePicker(pool); attPruner = new AttributePruner(pool); attRemover = new AttributeRemover(pool); cccec = new CombinedChildContentExpCreator(pool); ecc = new ElementsOfConcernCollector(); attToken = new AttributeToken(this,null,null,null,null); }
/** eats string literal */ public final boolean onText2( String literal, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) { if(!super.onText2(literal,context,refErr,refType)) return false; final StringToken token = new StringToken(docDecl,literal,context); final ResidualCalculator res = docDecl.resCalc; // some may become invalid, but at least one always remain valid for( int i=0; i<contents.length; i++ ) contents[i] = res.calcResidual( contents[i], token ); return true; }
ResidualCalculator resCalc = new ResidualCalculator(reader.pool); if(!resCalc.calcResidual( exp.exp, token ).isEpsilonReducible() ) {
/** * creates an object that validates the specified expression. */ public REDocumentDeclaration( Expression topLevel, ExpressionPool pool ) { this.topLevel = topLevel; this.pool = pool; resCalc = new ResidualCalculator(pool); attFeeder = new AttributeFeeder(this); attPicker = new AttributePicker(pool); attPruner = new AttributePruner(pool); attRemover = new AttributeRemover(pool); cccec = new CombinedChildContentExpCreator(pool); ecc = new ElementsOfConcernCollector(); attToken = new AttributeToken(this,null,null,null,null); }
/** eats string literal */ public final boolean onText2( String literal, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) { if(!super.onText2(literal,context,refErr,refType)) return false; final StringToken token = new StringToken(docDecl,literal,context); final ResidualCalculator res = docDecl.resCalc; // some may become invalid, but at least one always remain valid for( int i=0; i<contents.length; i++ ) contents[i] = res.calcResidual( contents[i], token ); return true; }
ResidualCalculator resCalc = new ResidualCalculator(reader.pool); if(!resCalc.calcResidual( exp.exp, token ).isEpsilonReducible() ) {
/** * creates an object that validates the specified expression. */ public REDocumentDeclaration( Expression topLevel, ExpressionPool pool ) { this.topLevel = topLevel; this.pool = pool; resCalc = new ResidualCalculator(pool); attFeeder = new AttributeFeeder(this); attPicker = new AttributePicker(pool); attPruner = new AttributePruner(pool); attRemover = new AttributeRemover(pool); cccec = new CombinedChildContentExpCreator(pool); ecc = new ElementsOfConcernCollector(); attToken = new AttributeToken(this,null,null,null,null); }
/** eats string literal */ public final boolean onText2( String literal, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) { if(!super.onText2(literal,context,refErr,refType)) return false; final StringToken token = new StringToken(docDecl,literal,context); final ResidualCalculator res = docDecl.resCalc; // some may become invalid, but at least one always remain valid for( int i=0; i<contents.length; i++ ) contents[i] = res.calcResidual( contents[i], token ); return true; }
protected boolean stepForward( Token token, StringRef errRef ) { Expression residual = docDecl.resCalc.calcResidual( expression, token );
protected boolean stepForward( Token token, StringRef errRef ) { Expression residual = docDecl.resCalc.calcResidual( expression, token );
protected boolean stepForward( Token token, StringRef errRef ) { Expression residual = docDecl.resCalc.calcResidual( expression, token );
protected boolean stepForward( Token token, StringRef errRef ) { Expression residual = docDecl.resCalc.calcResidual( expression, token );
/** compute the residual */ public final Expression calcResidual( Expression exp, Token token ) { if( token instanceof ElementToken ) return calcResidual(exp,(ElementToken)token); this.token=token; Expression r = exp.visit(this); // if token is ignorable, make expression as so. if( token.isIgnorable() ) r = pool.createChoice(r,exp); return r; }
public boolean match( AttributeExp exp ) { // Attribute name must meet the constraint of NameClass if(!exp.nameClass.accepts(namespaceURI,localName)) return false; // content model of the attribute must consume the value boolean satisfied = false; if(value.literal.trim().length()==0 && exp.exp.isEpsilonReducible()) satisfied = true; else if(docDecl.resCalc.calcResidual(exp.exp, value).isEpsilonReducible()) satisfied = true; if(satisfied) { // store the expression who consumed this token. if( !saturated || exp==matchedExp ) matchedExp=exp; else matchedExp=null; /* the above is the shortened form of: if( !saturated ) matchedExp = exp; else if( exp!=matchedExp ) matchedExp = null; */ saturated = true; return true; } return false; }
/** compute the residual */ public final Expression calcResidual( Expression exp, Token token ) { if( token instanceof ElementToken ) return calcResidual(exp,(ElementToken)token); this.token=token; Expression r = exp.visit(this); // if token is ignorable, make expression as so. if( token.isIgnorable() ) r = pool.createChoice(r,exp); return r; }
public boolean match( AttributeExp exp ) { // Attribute name must meet the constraint of NameClass if(!exp.nameClass.accepts(namespaceURI,localName)) return false; // content model of the attribute must consume the value if(!docDecl.resCalc.calcResidual(exp.exp, value).isEpsilonReducible()) failedExp = docDecl.pool.createChoice( failedExp, exp.exp ); // accept AttributeExp regardless of its content restriction return true; }