/* Generated By:JavaCC: Do not edit this line. FMParserTokenManager.java */
package freemarker.core;
import freemarker.template.*;
import freemarker.template.utility.StringUtil;
import freemarker.template.utility.DeepUnwrap;
import java.io.*;
import java.util.*;
class FMParserTokenManager implements FMParserConstants
{
/**
The noparseTag is set when we enter
a block of text that the parser more or less ignores.
These are <noparse> and <comment>. This variable
tells us what the closing tag should be, and when
we hit that, we resume parsing. Note that with this
scheme, <comment> and <noparse> tags cannot nest
recursively, but it is not clear how important that is.
*/
String noparseTag;
/**
Keeps track of how deeply nested
we have the hash literals.
This is necessary since we need to be
able to distinguish the } used to close
a hash literal and the one used to
close a ${
*/
private int hashLiteralNesting;
private int parenthesisNesting;
private int bracketNesting;
private boolean inFTLHeader;
boolean strictEscapeSyntax,
onlyTextOutput,
altDirectiveSyntax,
autodetectTagSyntax,
directiveSyntaxEstablished,
inInvocation;
String templateName;
// This method checks if we are in a strict mode where all
// FreeMarker directives must start with <#
private void strictSyntaxCheck(Token tok, int newLexState) {
if (onlyTextOutput) {
tok.kind = PRINTABLE_CHARS;
return;
}
char firstChar = tok.image.charAt(0);
if (autodetectTagSyntax && !directiveSyntaxEstablished) {
altDirectiveSyntax = (firstChar == '[');
}
if ((firstChar == '[' && !altDirectiveSyntax) || (firstChar == '<' && altDirectiveSyntax)) {
tok.kind = PRINTABLE_CHARS;
return;
}
if (!strictEscapeSyntax) {
SwitchTo(newLexState);
return;
}
if (!altDirectiveSyntax) {
if (!tok.image.startsWith("<#") && !tok.image.startsWith("</#")) {
tok.kind = PRINTABLE_CHARS;
return;
}
}
directiveSyntaxEstablished = true;
SwitchTo(newLexState);
}
private void unifiedCall(Token tok) {
char firstChar = tok.image.charAt(0);
if (autodetectTagSyntax && !directiveSyntaxEstablished) {
altDirectiveSyntax = (firstChar == '[');
}
if (altDirectiveSyntax && firstChar == '<') {
tok.kind = PRINTABLE_CHARS;
return;
}
if (!altDirectiveSyntax && firstChar == '[') {
tok.kind = PRINTABLE_CHARS;
return;
}
directiveSyntaxEstablished = true;
SwitchTo(NO_SPACE_EXPRESSION);
}
private void unifiedCallEnd(Token tok) {
char firstChar = tok.image.charAt(0);
if (altDirectiveSyntax && firstChar == '<') {
tok.kind = PRINTABLE_CHARS;
return;
}
if (!altDirectiveSyntax && firstChar == '[') {
tok.kind = PRINTABLE_CHARS;
return;
}
}
private void closeBracket(Token tok) {
if (bracketNesting >0) {
--bracketNesting;
} else {
tok.kind=DIRECTIVE_END;
if (inFTLHeader) {
eatNewline();
inFTLHeader = false;
}
SwitchTo(DEFAULT);
}
}
private void eatNewline() {
int charsRead = 0;
try {
while (true) {
char c = input_stream.readChar();
++charsRead;
if (!Character.isWhitespace(c)) {
input_stream.backup(charsRead);
return;
} else if (c=='\r') {
char next = input_stream.readChar();
++charsRead;
if (next != '\n') {
input_stream.backup(1);
}
return;
} else if (c=='\n') {
return;
}
}
} catch (IOException ioe) {
input_stream.backup(charsRead);
}
}
private void ftlHeader(Token matchedToken) {
if (!directiveSyntaxEstablished) {
altDirectiveSyntax = matchedToken.image.charAt(0) == '[';
directiveSyntaxEstablished = true;
autodetectTagSyntax = false;
}
String img = matchedToken.image;
char firstChar = img.charAt(0);
char lastChar = img.charAt(img.length() -1);
if ((firstChar == '[' && !altDirectiveSyntax) || (firstChar == '<' && altDirectiveSyntax)) {
matchedToken.kind = PRINTABLE_CHARS;
}
if (matchedToken.kind != PRINTABLE_CHARS) {
if (lastChar != '>' && lastChar != ']') {
SwitchTo(FM_EXPRESSION);
inFTLHeader = true;
} else {
eatNewline();
}
}
}
public java.io.PrintStream debugStream = System.out;
public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
private final int jjMoveStringLiteralDfa0_7()
{
return jjMoveNfa_7(0, 0);
}
private final void jjCheckNAdd(int state)
{
if (jjrounds[state] != jjround)
{
jjstateSet[jjnewStateCnt++] = state;
jjrounds[state] = jjround;
}
}
private final void jjAddStates(int start, int end)
{
do {
jjstateSet[jjnewStateCnt++] = jjnextStates[start];
} while (start++ != end);
}
private final void jjCheckNAddTwoStates(int state1, int state2)
{
jjCheckNAdd(state1);
jjCheckNAdd(state2);
}
private final void jjCheckNAddStates(int start, int end)
{
do {
jjCheckNAdd(jjnextStates[start]);
} while (start++ != end);
}
private final void jjCheckNAddStates(int start)
{
jjCheckNAdd(jjnextStates[start]);
jjCheckNAdd(jjnextStates[start + 1]);
}
static final long[] jjbitVec0 = {
0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
};
static final long[] jjbitVec2 = {
0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
};
private final int jjMoveNfa_7(int startState, int curPos)
{
int[] nextStates;
int startsAt = 0;
jjnewStateCnt = 13;
int i = 1;
jjstateSet[0] = startState;
int j, kind = 0x7fffffff;
for (;;)
{
if (++jjround == 0x7fffffff)
ReInitRounds();
if (curChar < 64)
{
long l = 1L << curChar;
MatchLoop: do
{
switch(jjstateSet[--i])
{
case 0:
if ((0xefffdfffffffffffL & l) != 0L)
{
if (kind > 131)
kind = 131;
jjCheckNAdd(6);
}
else if ((0x1000200000000000L & l) != 0L)
{
if (kind > 132)
kind = 132;
}
if (curChar == 45)
jjAddStates(0, 1);
else if (curChar == 60)
jjstateSet[jjnewStateCnt++] = 1;
break;
case 1:
if (curChar == 47)
jjCheckNAddTwoStates(2, 3);
break;
case 2:
if (curChar == 35)
jjCheckNAdd(3);
break;
case 4:
if ((0x100002600L & l) != 0L)
jjAddStates(2, 3);
break;
case 5:
if (curChar == 62 && kind > 130)
kind = 130;
break;
case 6:
if ((0xefffdfffffffffffL & l) == 0L)
break;
if (kind > 131)
kind = 131;
jjCheckNAdd(6);
break;
case 7:
if ((0x1000200000000000L & l) != 0L && kind > 132)
kind = 132;
break;
没有合适的资源?快使用搜索试试~ 我知道了~
freemarker-2.3.15
5星 · 超过95%的资源 需积分: 9 22 下载量 198 浏览量
2009-05-16
13:39:24
上传
评论
收藏 2.07MB GZ 举报
温馨提示
共1157个文件
html:672个
java:327个
txt:54个
概述:freemarker-2.3.15~~~~~~
资源详情
资源评论
资源推荐
收起资源包目录
freemarker-2.3.15 (1157个子文件)
fmdoc.css 1KB
stylesheet.css 1KB
site.css 1KB
web-app_2_3.dtd 32KB
web-app_2_2.dtd 18KB
web-jsptaglibrary_1_2.dtd 11KB
web-jsptaglibrary_1_1.dtd 5KB
ftl.el 7KB
PerformanceTest.fm 76B
faq2html.ftl 1KB
form.ftl 737B
test-recover.ftl 721B
index.ftl 709B
index.ftl 696B
test-recover.ftl 608B
common.ftl 586B
common.ftl 571B
form.ftl 550B
add.ftl 409B
add.ftl 372B
test-default.ftl 219B
test.ftl 111B
nestedinclude.ftl 82B
test-default.ftl 42B
undefined.ftl 21B
next.gif 2KB
next_disabled.gif 2KB
prev.gif 2KB
prev_disabled.gif 2KB
up.gif 1KB
up_disabled.gif 1KB
1.gif 968B
8.gif 968B
10.gif 968B
7.gif 968B
4.gif 968B
3.gif 968B
5.gif 968B
2.gif 968B
6.gif 968B
9.gif 968B
15.gif 244B
12.gif 244B
11.gif 244B
13.gif 244B
14.gif 244B
inherit.gif 57B
none.gif 42B
none.gif 42B
kwriteftl.tar.gz 1KB
fm-eclipse-help.tar.gz 970B
index-all.html 430KB
FMParser.html 168KB
constant-values.html 161KB
dgui_template_exp.html 125KB
TemplateModel.html 106KB
ref_builtins_string.html 104KB
ParseException.html 102KB
Template.WrongEncodingException.html 99KB
Configuration.html 87KB
app_faq.html 86KB
TemplateModelException.html 86KB
xgui_imperative_learn.html 75KB
Environment.html 72KB
Configurable.html 65KB
package-use.html 64KB
dgui_misc_userdefdir.html 62KB
versions_2_3.html 60KB
alphaidx.html 59KB
Template.html 57KB
BeansWrapper.html 52KB
FreemarkerServlet.html 51KB
overview-tree.html 47KB
NodeModel.html 46KB
versions_2_2.html 44KB
pgui_misc_servlet.html 42KB
ParseException.html 42KB
dgui_quickstart_template.html 41KB
ObjectWrapper.html 41KB
pgui_misc_beanwrapper.html 41KB
NodeListModel.html 40KB
ref_directive_macro.html 40KB
TemplateException.html 39KB
ref_builtins_sequence.html 39KB
NodeListModel.html 39KB
StringUtil.html 39KB
TemplateHashModel.html 37KB
serialized-form.html 35KB
dgui_misc_namespace.html 35KB
FreemarkerXmlTask.html 34KB
BeanModel.html 33KB
ref_directive_visit.html 32KB
SimpleCharStream.html 32KB
TemplateCollectionModel.html 32KB
poweredBy.html 32KB
pgui_config_errorhandling.html 31KB
SimpleHash.html 31KB
IdentityHashMap.html 31KB
DebugModel.html 30KB
ref_builtins_number.html 29KB
共 1157 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
wangzukun
- 粉丝: 3
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1