javax0.jamal.api.PositionStack Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jamal-api Show documentation
Show all versions of jamal-api Show documentation
Jamal macro library API interfaces
package javax0.jamal.api;
import java.util.LinkedList;
/**
* A simple position stack implementation used in the default implementation of {@link Macro#fetch(Processor, Input)}.
*/
class PositionStack {
final private LinkedList refStack;
PositionStack(Position pos) {
refStack = new LinkedList<>();
refStack.add(pos);
}
Position pop() {
return refStack.pop();
}
void push(Position pos) {
refStack.push(pos);
}
boolean popAndEmpty() {
refStack.pop();
return refStack.size() == 0;
}
int size() {
return refStack.size();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy