1 6 7 package com.hp.hpl.jena.graph.query.regexptrees; 8 9 import java.util.List ; 10 11 15 public class SimpleGenerator implements RegexpTreeGenerator 16 { 17 public RegexpTree getAnySingle() { return RegexpTree.ANY; } 18 public RegexpTree getStartOfLine() { return RegexpTree.SOL; } 19 public RegexpTree getEndOfLine() { return RegexpTree.EOL; } 20 public RegexpTree getNothing() { return RegexpTree.NON; } 21 22 public RegexpTree getText( char ch ) { return Text.create( ch ); } 23 24 public RegexpTree getZeroOrMore( RegexpTree d ) { return new ZeroOrMore( d ); } 25 public RegexpTree getOneOrMore( RegexpTree d ) { return new OneOrMore( d ); } 26 public RegexpTree getOptional( RegexpTree d ) { return new Optional( d ); } 27 28 public RegexpTree getSequence( List operands ) { return Sequence.create( operands ); } 29 public RegexpTree getAlternatives( List operands ) { return Alternatives.create( operands ); } 30 31 public RegexpTree getBackReference( int n ) { return new BackReference( n ); } 32 33 public RegexpTree getClass( String chars, boolean reject ) 34 { return reject ? (RegexpTree) new NoneOf( chars ) : new AnyOf( chars ); } 35 36 public RegexpTree getParen( RegexpTree operand, int index ) 37 { return new Paren( operand, index ); } 38 } 39 40 | Popular Tags |