bitmark-grammar
Version:
24 lines (20 loc) • 704 B
text/typescript
/*!
* Copyright 2016 The ANTLR Project. All rights reserved.
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
*/
// CONVERSTION complete, Burt Harris 10/14/2016
import { Override } from "../../Decorators";
import { ParseTree } from "../ParseTree";
import { Trees } from "../Trees";
import { XPathElement } from "./XPathElement";
export class XPathTokenAnywhereElement extends XPathElement {
protected tokenType: number;
constructor(tokenName: string, tokenType: number) {
super(tokenName);
this.tokenType = tokenType;
}
public evaluate(t: ParseTree): ParseTree[] {
return Trees.findAllTokenNodes(t, this.tokenType);
}
}