
com.pippsford.stencil.parser.Match Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stencil Show documentation
Show all versions of stencil Show documentation
Stencil templating system
The newest version!
package com.pippsford.stencil.parser;
import com.pippsford.stencil.blocks.BlockTypes;
/**
* A match during compilation.
*/
class Match {
/**
* The type of the match.
*/
final BlockTypes type;
/** The source text. */
private final String source;
/**
* End of match.
*/
int end;
/**
* Start of match.
*/
int start;
/**
* Text that was matched.
*/
String text;
/**
* New match.
*
* @param type block type to match
*/
Match(BlockTypes type, String source) {
this.type = type;
this.source = source;
}
/**
* Copy constructor.
*
* @param original the original
*/
protected Match(Match original) {
type = original.type;
source = original.source;
end = original.end;
start = original.start;
text = original.text;
}
Location getLocation() {
return new Location(source, start);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy