本文整理汇总了Java中jdk.nashorn.internal.runtime.Source.getLength方法的典型用法代码示例。如果您正苦于以下问题:Java Source.getLength方法的具体用法?Java Source.getLength怎么用?Java Source.getLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.runtime.Source
的用法示例。
在下文中一共展示了Source.getLength方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractParser
import jdk.nashorn.internal.runtime.Source; //导入方法依赖的package包/类
/**
* Construct a parser.
*
* @param source Source to parse.
* @param errors Error reporting manager.
* @param strict True if we are in strict mode
* @param lineOffset Offset from which lines should be counted
*/
protected AbstractParser(final Source source, final ErrorManager errors, final boolean strict, final int lineOffset) {
if (source.getLength() > Token.LENGTH_MASK) {
throw new RuntimeException("Source exceeds size limit of " + Token.LENGTH_MASK + " bytes");
}
this.source = source;
this.errors = errors;
this.k = -1;
this.token = Token.toDesc(EOL, 0, 1);
this.type = EOL;
this.last = EOL;
this.isStrictMode = strict;
this.lineOffset = lineOffset;
}
示例2: Lexer
import jdk.nashorn.internal.runtime.Source; //导入方法依赖的package包/类
/**
* Constructor
*
* @param source the source
* @param stream the token stream to lex
* @param scripting are we in scripting mode
*/
public Lexer(final Source source, final TokenStream stream, final boolean scripting) {
this(source, 0, source.getLength(), stream, scripting, false);
}
示例3: Lexer
import jdk.nashorn.internal.runtime.Source; //导入方法依赖的package包/类
/**
* Constructor
*
* @param source the source
* @param stream the token stream to lex
* @param scripting are we in scripting mode
* @param es6 are we in ECMAScript 6 mode
*/
public Lexer(final Source source, final TokenStream stream, final boolean scripting, final boolean es6) {
this(source, 0, source.getLength(), stream, scripting, es6, false);
}