91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 11KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-06-28
  • 語言: Java
  • 標(biāo)簽: ANTLR??解釋器??

資源簡介

程序分析課程上機(jī)要求,方便廣大學(xué)子拷貝。其中.g為ANTLR源文件,可生成語法分析器和語法樹的.java文件,然后進(jìn)行必要的修改(添加成員變量)。提供的.java文件已經(jīng)修改好。直接放在項(xiàng)目里,選擇主類Frame,編譯運(yùn)行即可。在窗口里輸入測試文件的路徑,即可繪出圖像。

資源截圖

代碼片段和文件信息

//?$ANTLR?2.7.7?(20060930):?“parer.g“?->?“DrawLexer.java“$
package?fcc;
import?java.io.InputStream;
import?antlr.TokenStreamException;
import?antlr.TokenStreamIOException;
import?antlr.TokenStreamRecognitionException;
import?antlr.CharStreamException;
import?antlr.CharStreamIOException;
import?antlr.ANTLRException;
import?java.io.Reader;
import?java.util.Hashtable;
import?antlr.CharScanner;
import?antlr.InputBuffer;
import?antlr.ByteBuffer;
import?antlr.CharBuffer;
import?antlr.Token;
import?antlr.CommonToken;
import?antlr.RecognitionException;
import?antlr.NoViableAltForCharException;
import?antlr.MismatchedCharException;
import?antlr.TokenStream;
import?antlr.ANTLRHashString;
import?antlr.LexerSharedInputState;
import?antlr.collections.impl.BitSet;
import?antlr.SemanticException;

public?class?DrawLexer?extends?antlr.CharScanner?implements?DrawParserTokenTypes?TokenStream
?{
public?DrawLexer(InputStream?in)?{
this(new?ByteBuffer(in));
}
public?DrawLexer(Reader?in)?{
this(new?CharBuffer(in));
}
public?DrawLexer(InputBuffer?ib)?{
this(new?LexerSharedInputState(ib));
}
public?DrawLexer(LexerSharedInputState?state)?{
super(state);
caseSensitiveLiterals?=?false;
setCaseSensitive(false);
literals?=?new?Hashtable();
}

public?Token?nextToken()?throws?TokenStreamException?{
Token?theRetToken=null;
tryAgain:
for?(;;)?{
Token?_token?=?null;
int?_ttype?=?Token.INVALID_TYPE;
resetText();
try?{???//?for?char?stream?error?handling
try?{???//?for?lexical?error?handling
switch?(?LA(1))?{
case?‘o‘:
{
mORIGIN(true);
theRetToken=_returnToken;
break;
}
case?‘r‘:
{
mROT(true);
theRetToken=_returnToken;
break;
}
case?‘i‘:
{
mIS(true);
theRetToken=_returnToken;
break;
}
case?‘d‘:
{
mDRAW(true);
theRetToken=_returnToken;
break;
}
case?‘+‘:
{
mPLUS(true);
theRetToken=_returnToken;
break;
}
case?‘;‘:
{
mSEMICO(true);
theRetToken=_returnToken;
break;
}
case?‘(‘:
{
mLPAREN(true);
theRetToken=_returnToken;
break;
}
case?‘)‘:
{
mRPAREN(true);
theRetToken=_returnToken;
break;
}
case?‘‘:
{
mCOMMA(true);
theRetToken=_returnToken;
break;
}
case?‘p‘:
{
mPI(true);
theRetToken=_returnToken;
break;
}
case?‘0‘:??case?‘1‘:??case?‘2‘:??case?‘3‘:
case?‘4‘:??case?‘5‘:??case?‘6‘:??case?‘7‘:
case?‘8‘:??case?‘9‘:
{
mNUM(true);
theRetToken=_returnToken;
break;
}
case?‘c‘:
{
mCOS(true);
theRetToken=_returnToken;
break;
}
case?‘l‘:
{
mLOG(true);
theRetToken=_returnToken;
break;
}
case?‘\t‘:??case?‘\n‘:??case?‘\r‘:??case?‘?‘:
{
mWS(true);
theRetToken=_returnToken;

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件???????1741??2012-06-08?14:05??fcc\fcc\treewalker.g

?????文件????????685??2012-06-08?10:49??fcc\fcc\DrawParserTokenTypes.java

?????文件????????719??2012-06-08?10:56??fcc\fcc\DrawTreeWalkerTokenTypes.java

?????文件??????21295??2012-06-08?11:08??fcc\fcc\DrawLexer.java

?????文件???????2035??2012-06-08?14:05??fcc\fcc\parer.g

?????文件??????15807??2012-06-08?13:45??fcc\fcc\DrawParser.java

?????文件???????9276??2012-06-08?13:57??fcc\fcc\DrawTreeWalker.java

?????文件???????6542??2012-06-10?18:59??fcc\fcc\frame.java

?????文件????????204??2012-06-10?18:57??fcc\fcc\test.txt

?????目錄??????????0??2012-06-08?11:02??fcc\fcc

?????目錄??????????0??2012-06-08?09:25??fcc

-----------?---------??----------?-----??----

????????????????58304????????????????????11


評論

共有 條評論