亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? parser.cs

?? 全功能c#編譯器
?? CS
?? 第 1 頁 / 共 5 頁
字號:

#line  1 "cs.ATG" 
using System.Drawing;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using ICSharpCode.CsVbRefactory.Parser;
using ICSharpCode.CsVbRefactory.Parser.AST;
using System;
using System.Reflection;

namespace ICSharpCode.CsVbRefactory.Parser.CSharp {



public class Parser : IDisposable
{
	const int maxT = 125;

	const  bool   T            = true;
	const  bool   x            = false;
	const  int    minErrDist   = 2;
	const  string errMsgFormat = "-- line {0} col {1}: {2}";  // 0=line, 1=column, 2=text
	int    errDist             = minErrDist;
	Errors errors;
	Lexer  lexer;

	public Errors Errors {
		get {
			return errors;
		}
	}


#line  11 "cs.ATG" 
string assemblyName = null;

public CompilationUnit compilationUnit;

public string ContainingAssembly {
	set {
		assemblyName = value;
	}
}

Token t {
	get {
		return lexer.Token;
	}
}
Token la {
	get {
		return lexer.LookAhead;
	}
}

Hashtable typeStrings     = null;
ArrayList usingNamespaces = null;

public void Error(string s)
{
	if (errDist >= minErrDist) {
		errors.Error(la.line, la.col, s);
	}
	errDist = 0;
}

public Expression ParseExpression(Lexer lexer)
{
	this.errors = lexer.Errors;
	this.lexer = lexer;
	errors.SynErr = new ErrorCodeProc(SynErr);
	lexer.NextToken();
	Expression expr;
	Expr(out expr);
	return expr;
}

bool IsTypeCast()
{
	if (IsSimpleTypeCast()) {
		return true;
	}
	
	if (assemblyName != null) {
		return CheckTypeCast();
	}
	
	return GuessTypeCast();
}

bool IsSimpleTypeCast()
{
	// check: "(" pointer or array of keyword type ")"
	
	if (la.kind != Tokens.OpenParenthesis) {
		return false;
	}

	StartPeek();
	Token pt1 = Peek();
	Token pt  = Peek();
	
	return ParserUtil.IsTypeKW(pt1) && IsPointerOrDims(ref pt) &&
	       pt.kind == Tokens.CloseParenthesis;
}

bool CheckTypeCast()
{
	// check: leading "(" pointer or array of some type ")"

	if (la.kind != Tokens.OpenParenthesis) {
		return false;
	}
	
	string qualident;
	
	StartPeek();
	Token pt = Peek();
	
	return IsQualident(ref pt, out qualident) && IsPointerOrDims(ref pt) && 
	       pt.kind == Tokens.CloseParenthesis && IsType(qualident);		
}

bool IsType(string qualident)
{
	if (typeStrings == null) {
		CreateTypeStrings();
	}
	
	if (typeStrings.ContainsValue(qualident)) {
		return true;
	}
	
	foreach (string ns in usingNamespaces) {
		if (typeStrings.ContainsValue(String.Concat(ns, '.', qualident))) {
			return true;
		}
	}
	return false;
}

bool GuessTypeCast()
{
	// check: "(" pointer or array of some type ")" possible type cast successor
	
	if (la.kind != Tokens.OpenParenthesis) return false;
	
	string qualident;
	
	StartPeek();
	Token pt = Peek();
	
	if (IsQualident(ref pt, out qualident) && IsPointerOrDims(ref pt) && 
	    pt.kind == Tokens.CloseParenthesis) {
		// check successor
		pt = Peek();
		return pt.kind == Tokens.Identifier || pt.kind == Tokens.Literal   ||
		       pt.kind == Tokens.OpenParenthesis   || ParserUtil.IsUnaryOperator(pt)         ||
		       pt.kind == Tokens.New        || pt.kind == Tokens.This      ||
		       pt.kind == Tokens.Base       || pt.kind == Tokens.Null      ||
		       pt.kind == Tokens.Checked    || pt.kind == Tokens.Unchecked ||
		       pt.kind == Tokens.Typeof     || pt.kind == Tokens.Sizeof    ||
		       (ParserUtil.IsTypeKW(pt) && Peek().kind == Tokens.Dot);
	} else return false;
}

void CreateTypeStrings()
{
	Assembly a;
	Type[] types;
	AssemblyName [] aNames;
	
	if (assemblyName != null && assemblyName.Length > 0) {    /* AW 2002-12-30 add check for length > 0 */
		typeStrings = new Hashtable();
		a = Assembly.LoadFrom(assemblyName);
		types = a.GetTypes();
		foreach (Type t in types) 
			typeStrings.Add(t.FullName.GetHashCode(), t.FullName);
		aNames = a.GetReferencedAssemblies();
		
		for (int i = 0; i < aNames.Length; i++) {
			a = Assembly.LoadFrom(aNames[i].Name);
			types = a.GetExportedTypes();
			
			foreach(Type t in types)
				if (usingNamespaces.Contains(t.FullName.Substring(0, t.FullName.LastIndexOf('.'))))
					typeStrings.Add(t.FullName.GetHashCode(), t.FullName);
		}
	}
}

/* Checks whether the next sequences of tokens is a qualident *
 * and returns the qualident string                           */
/* !!! Proceeds from current peek position !!! */
bool IsQualident(ref Token pt, out string qualident)
{
	if (pt.kind == Tokens.Identifier) {
		StringBuilder qualidentsb = new StringBuilder(pt.val);
		pt = Peek();
		while (pt.kind == Tokens.Dot) {
			pt = Peek();
			if (pt.kind != Tokens.Identifier) {
				qualident = String.Empty;
				return false;
			}
			qualidentsb.Append('.');
			qualidentsb.Append(pt.val);
			pt = Peek();
		}
		qualident = qualidentsb.ToString();
		return true;
	}
	qualident = String.Empty;
	return false;
}

/* skip: { "*" | "[" { "," } "]" } */
/* !!! Proceeds from current peek position !!! */
bool IsPointerOrDims (ref Token pt)
{
	for (;;) {
		if (pt.kind == Tokens.OpenSquareBracket) {
			do pt = Peek();
			while (pt.kind == Tokens.Comma);
			if (pt.kind != Tokens.CloseSquareBracket) return false;
		} else if (pt.kind != Tokens.Times) break;
		pt = Peek();
	}
	return true;
}

/* Return the n-th token after the current lookahead token */
void StartPeek()
{
	lexer.StartPeek();
}

Token Peek()
{
	return lexer.Peek();
}

Token Peek (int n)
{
	lexer.StartPeek();
	Token x = la;
	while (n > 0) {
		x = lexer.Peek();
		n--;
	}
	return x;
}

/*-----------------------------------------------------------------*
 * Resolver routines to resolve LL(1) conflicts:                   *                                                  *
 * These resolution routine return a boolean value that indicates  *
 * whether the alternative at hand shall be choosen or not.        *
 * They are used in IF ( ... ) expressions.                        *       
 *-----------------------------------------------------------------*/

/* True, if ident is followed by "=" */
bool IdentAndAsgn ()
{
	return la.kind == Tokens.Identifier && Peek(1).kind == Tokens.Assign;
}

bool IsAssignment () { return IdentAndAsgn(); }

/* True, if ident is followed by ",", "=", or ";" */
bool IdentAndCommaOrAsgnOrSColon () {
	int peek = Peek(1).kind;
	return la.kind == Tokens.Identifier && 
	       (peek == Tokens.Comma || peek == Tokens.Assign || peek == Tokens.Semicolon);
}
bool IsVarDecl () { return IdentAndCommaOrAsgnOrSColon(); }

/* True, if the comma is not a trailing one, *
 * like the last one in: a, b, c,            */
bool NotFinalComma () {
	int peek = Peek(1).kind;
	return la.kind == Tokens.Comma &&
	       peek != Tokens.CloseCurlyBrace && peek != Tokens.CloseSquareBracket;
}

/* True, if "void" is followed by "*" */
bool NotVoidPointer () {
	return la.kind == Tokens.Void && Peek(1).kind != Tokens.Times;
}

/* True, if "checked" or "unchecked" are followed by "{" */
bool UnCheckedAndLBrace () {
	return la.kind == Tokens.Checked || la.kind == Tokens.Unchecked &&
	       Peek(1).kind == Tokens.OpenCurlyBrace;
}

/* True, if "." is followed by an ident */
bool DotAndIdent () {
	return la.kind == Tokens.Dot && Peek(1).kind == Tokens.Identifier;
}

/* True, if ident is followed by ":" */
bool IdentAndColon () {
	return la.kind == Tokens.Identifier && Peek(1).kind == Tokens.Colon;
}

bool IsLabel () { return IdentAndColon(); }

/* True, if ident is followed by "(" */
bool IdentAndLPar () {
	return la.kind == Tokens.Identifier && Peek(1).kind == Tokens.OpenParenthesis;
}

/* True, if "catch" is followed by "(" */
bool CatchAndLPar () {
	return la.kind == Tokens.Catch && Peek(1).kind == Tokens.OpenParenthesis;
}
bool IsTypedCatch () { return CatchAndLPar(); }

/* True, if "[" is followed by the ident "assembly" */
bool IsGlobalAttrTarget () {
	Token pt = Peek(1);
	return la.kind == Tokens.OpenSquareBracket && 
	       pt.kind == Tokens.Identifier && pt.val == "assembly";
}

/* True, if "[" is followed by "," or "]" */
bool LBrackAndCommaOrRBrack () {
	int peek = Peek(1).kind;
	return la.kind == Tokens.OpenSquareBracket &&
	       (peek == Tokens.Comma || peek == Tokens.CloseSquareBracket);
}

bool IsDims () { return LBrackAndCommaOrRBrack(); }

/* True, if "[" is followed by "," or "]" *
 * or if the current token is "*"         */
bool TimesOrLBrackAndCommaOrRBrack () {
	return la.kind == Tokens.Times || LBrackAndCommaOrRBrack();
}
bool IsPointerOrDims () { return TimesOrLBrackAndCommaOrRBrack(); }
bool IsPointer () { return la.kind == Tokens.Times; }

/* True, if lookahead is a primitive type keyword, or *
 * if it is a type declaration followed by an ident   */
bool IsLocalVarDecl () {
	if ((ParserUtil.IsTypeKW(la) && Peek(1).kind != Tokens.Dot) || la.kind == Tokens.Void) return true;
	
	StartPeek();
	Token pt = la ;  // peek token
	string ignore;
	
	return IsQualident(ref pt, out ignore) && IsPointerOrDims(ref pt) && 
	       pt.kind == Tokens.Identifier;
}

/* True, if lookahead ident is "get" */
bool IdentIsGet () {
	return la.kind == Tokens.Identifier && la.val == "get";
}

/* True, if lookahead ident is "set" */
bool IdentIsSet () {
	return la.kind == Tokens.Identifier && la.val == "set";
}

/* True, if lookahead ident is "add" */
bool IdentIsAdd () {
	return la.kind == Tokens.Identifier && la.val == "add";
}

/* True, if lookahead ident is "remove" */
bool IdentIsRemove () {
	return la.kind == Tokens.Identifier && la.val == "remove";
}

/* True, if lookahead is a local attribute target specifier, *
 * i.e. one of "event", "return", "field", "method",         *
 *             "module", "param", "property", or "type"      */
bool IsLocalAttrTarget () {
	int cur = la.kind;
	string val = la.val;

	return (cur == Tokens.Event || cur == Tokens.Return ||
	        (cur == Tokens.Identifier &&
	         (val == "field" || val == "method"   || val == "module" ||
	          val == "param" || val == "property" || val == "type"))) &&
	       Peek(1).kind == Tokens.Colon;
}


/*------------------------------------------------------------------------*
 *----- LEXER TOKEN LIST  ------------------------------------------------*
 *------------------------------------------------------------------------*/


/*

*/
	void SynErr(int n)
	{
		if (errDist >= minErrDist) {
			errors.SynErr(lexer.LookAhead.line, lexer.LookAhead.col, n);
		}
		errDist = 0;
	}

	public void SemErr(string msg)
	{
		if (errDist >= minErrDist) {
			errors.Error(lexer.Token.line, lexer.Token.col, msg);
		}
		errDist = 0;
	}
	
	void Expect(int n)
	{
		if (lexer.LookAhead.kind == n) {
			lexer.NextToken();
		} else {
			SynErr(n);
		}
	}
	
	bool StartOf(int s)
	{
		return set[s, lexer.LookAhead.kind];
	}
	
	void ExpectWeak(int n, int follow)
	{
		if (lexer.LookAhead.kind == n) {
			lexer.NextToken();
		} else {
			SynErr(n);
			while (!StartOf(follow)) {
				lexer.NextToken();
			}
		}
	}
	
	bool WeakSeparator(int n, int syFol, int repFol)
	{
		bool[] s = new bool[maxT + 1];
		
		if (lexer.LookAhead.kind == n) {
			lexer.NextToken();
			return true; 
		} else if (StartOf(repFol)) {
			return false;
		} else {
			for (int i = 0; i <= maxT; i++) {
				s[i] = set[syFol, i] || set[repFol, i] || set[0, i];
			}
			SynErr(n);
			while (!s[lexer.LookAhead.kind]) {
				lexer.NextToken();
			}
			return StartOf(syFol);
		}
	}
	
	void CS() {

#line  523 "cs.ATG" 
		compilationUnit = new CompilationUnit(); 
		while (la.kind == 120) {
			UsingDirective();
		}
		while (
#line  526 "cs.ATG" 
IsGlobalAttrTarget()) {
			GlobalAttributeSection();
		}
		while (StartOf(1)) {
			NamespaceMemberDecl();
		}
		Expect(0);
	}

	void UsingDirective() {

#line  533 "cs.ATG" 
		usingNamespaces = new ArrayList();
		string qualident = null, aliasident = null;
		
		Expect(120);

#line  537 "cs.ATG" 
		Point startPos = t.Location;
		INode node     = null; 
		
		if (
#line  540 "cs.ATG" 
IsAssignment()) {
			lexer.NextToken();

#line  540 "cs.ATG" 
			aliasident = t.val; 
			Expect(3);
		}
		Qualident(
#line  541 "cs.ATG" 
out qualident);

#line  541 "cs.ATG" 
		if (qualident != null && qualident.Length > 0) {
		 if (aliasident != null) {
		   node = new UsingAliasDeclaration(aliasident, qualident);
		 } else {
		     usingNamespaces.Add(qualident);
		     node = new UsingDeclaration(qualident);
		 }
		}
		
		Expect(10);

#line  550 "cs.ATG" 
		node.StartLocation = startPos;
		node.EndLocation   = t.EndLocation;
		compilationUnit.AddChild(node);
		
	}

	void GlobalAttributeSection() {
		Expect(16);

#line  559 "cs.ATG" 
		Point startPos = t.Location; 
		Expect(1);

#line  559 "cs.ATG" 
		if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected");
		string attributeTarget = t.val;
		List<ICSharpCode.CsVbRefactory.Parser.AST.Attribute> attributes = new List<ICSharpCode.CsVbRefactory.Parser.AST.Attribute>();
		ICSharpCode.CsVbRefactory.Parser.AST.Attribute attribute;
		
		Expect(9);
		Attribute(
#line  564 "cs.ATG" 
out attribute);

#line  564 "cs.ATG" 
		attributes.Add(attribute); 
		while (
#line  565 "cs.ATG" 
NotFinalComma()) {
			Expect(12);
			Attribute(
#line  565 "cs.ATG" 
out attribute);

#line  565 "cs.ATG" 
			attributes.Add(attribute); 
		}
		if (la.kind == 12) {
			lexer.NextToken();
		}
		Expect(17);

#line  567 "cs.ATG" 
		AttributeSection section = new AttributeSection(attributeTarget, attributes);
		section.StartLocation = startPos;
		section.EndLocation = t.EndLocation;
		compilationUnit.AddChild(section);
		
	}

	void NamespaceMemberDecl() {

#line  649 "cs.ATG" 
		AttributeSection section;
		List<AttributeSection> attributes = new List<AttributeSection>();
		Modifiers m = new Modifiers();
		string qualident;
		
		if (la.kind == 87) {
			lexer.NextToken();

#line  655 "cs.ATG" 
			Point startPos = t.Location; 
			Qualident(
#line  656 "cs.ATG" 
out qualident);

#line  656 "cs.ATG" 
			INode node =  new NamespaceDeclaration(qualident);
			node.StartLocation = startPos;
			compilationUnit.AddChild(node);
			compilationUnit.BlockStart(node);
			

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色呦呦网站一区| 黄色资源网久久资源365| 91精品福利视频| 亚洲激情欧美激情| 欧美三区在线观看| 日韩成人精品在线| 精品国产一区a| 国产成人午夜视频| 国产精品毛片a∨一区二区三区| 97精品国产露脸对白| 亚洲视频免费看| 在线播放欧美女士性生活| 美国av一区二区| 国产精品亲子伦对白| 色婷婷精品大在线视频| 亚洲成av人片一区二区梦乃| 日韩欧美中文一区| 国产在线不卡一区| 亚洲品质自拍视频| 日韩精品影音先锋| 波多野结衣在线aⅴ中文字幕不卡| 亚洲黄色av一区| 欧美成人国产一区二区| 91丨九色丨黑人外教| 日韩精品亚洲一区| 国产欧美一区二区三区沐欲| 在线观看免费一区| 国产在线麻豆精品观看| 亚洲精选免费视频| 精品免费99久久| 色久综合一二码| 极品少妇一区二区| 一区二区在线免费| 精品成人一区二区三区四区| 一本一本大道香蕉久在线精品| 免费成人在线影院| 亚洲精品久久嫩草网站秘色| 精品国产伦一区二区三区观看体验 | 欧美丰满一区二区免费视频| 国产一区二区三区在线观看免费视频 | 欧美精品在线观看一区二区| 国产精品白丝jk黑袜喷水| 亚洲色图一区二区三区| 精品国产一区二区三区四区四| 色婷婷av一区二区三区大白胸| 久久99国产精品免费| 一区二区三区国产豹纹内裤在线| 精品伦理精品一区| 欧美视频自拍偷拍| 成人午夜视频福利| 精品一区二区在线播放| 亚洲一区中文日韩| 国产精品嫩草影院com| 日韩写真欧美这视频| 在线精品视频小说1| 97se狠狠狠综合亚洲狠狠| 国产最新精品精品你懂的| 日本美女视频一区二区| 亚洲午夜国产一区99re久久| 国产精品国产三级国产a | 成人一区二区视频| 精品一区二区三区影院在线午夜| 亚洲r级在线视频| 亚洲精品国产第一综合99久久| 欧美国产欧美综合| 久久久久国产成人精品亚洲午夜| 日韩一区二区中文字幕| 91精品国产综合久久精品app| 日本久久一区二区三区| 91免费看视频| 色综合久久中文综合久久牛| 99久久国产免费看| 不卡视频免费播放| 99久久国产综合精品色伊 | 在线免费一区三区| 99精品欧美一区二区三区小说| 国产成人精品一区二| 国产大片一区二区| 国产传媒欧美日韩成人| 国产成人精品影视| 成人午夜精品在线| k8久久久一区二区三区 | 国产精品小仙女| 国产高清视频一区| 粉嫩高潮美女一区二区三区| 7777精品伊人久久久大香线蕉的 | 日韩欧美一二三区| 精品88久久久久88久久久| 2020国产精品| 国产日韩欧美精品一区| 国产精品伦理一区二区| 亚洲欧美日韩在线不卡| 亚洲成人免费看| 精品一区在线看| 高清不卡一区二区在线| 一本大道久久a久久综合| 欧美日韩中文字幕精品| 日韩一级二级三级| 国产丝袜欧美中文另类| 日韩理论片中文av| 日韩福利视频导航| 国产一区二区女| 97国产精品videossex| 欧美日韩一区中文字幕| 精品国精品自拍自在线| 亚洲国产高清在线| 亚洲制服丝袜av| 老鸭窝一区二区久久精品| 高清成人免费视频| 欧美日韩国产123区| 精品动漫一区二区三区在线观看| 国产精品美女久久久久aⅴ国产馆| 亚洲线精品一区二区三区| 激情综合色播激情啊| 91香蕉视频黄| 日韩一区和二区| 国产精品乱人伦| 日本大胆欧美人术艺术动态 | 亚洲精品国产视频| 麻豆91免费观看| 91理论电影在线观看| 欧美一区二区三区日韩| 日本三级亚洲精品| 99久久久精品| 日韩精品中文字幕一区| 亚洲美女偷拍久久| 国产一区二区免费在线| 在线这里只有精品| 久久久久久久免费视频了| 亚洲成a人片在线观看中文| 国产剧情一区在线| 欧美日本一区二区在线观看| 亚洲国产精品av| 日韩av电影天堂| 色综合婷婷久久| 久久精品亚洲国产奇米99| 午夜精品久久久久影视| 99re热这里只有精品视频| 欧美v日韩v国产v| 亚洲一区中文日韩| 99视频精品在线| 久久丝袜美腿综合| 免费观看一级特黄欧美大片| 91久久人澡人人添人人爽欧美| 久久亚洲一区二区三区明星换脸| 午夜在线电影亚洲一区| 91一区二区在线观看| 久久久久久电影| 精品一区二区日韩| 91精品久久久久久久久99蜜臂| 一区二区三区在线观看国产| 成人丝袜高跟foot| 久久久久高清精品| 激情六月婷婷综合| 精品国产91久久久久久久妲己| 午夜精彩视频在线观看不卡| 91丝袜呻吟高潮美腿白嫩在线观看| 国产亚洲美州欧州综合国| 久久国内精品自在自线400部| 91麻豆精品国产91久久久使用方法 | 7799精品视频| 亚洲成人免费电影| 欧美日韩国产综合视频在线观看| 亚洲欧美日韩在线不卡| 91在线精品一区二区三区| 中文在线资源观看网站视频免费不卡 | 色综合久久综合| 中文字幕一区二区三区乱码在线| 国产成人免费视频一区| 国产日韩精品视频一区| 国产成人精品aa毛片| 国产精品私房写真福利视频| 成人免费视频免费观看| 国产精品二区一区二区aⅴ污介绍| 国产99一区视频免费| 欧美高清在线精品一区| 成人晚上爱看视频| 国产精品私人自拍| 色综合久久中文综合久久牛| 亚洲一区在线播放| 7878成人国产在线观看| 美女一区二区视频| 精品福利一区二区三区免费视频| 国内成人免费视频| 国产精品妹子av| 色一区在线观看| 污片在线观看一区二区| 日韩视频一区二区三区在线播放| 加勒比av一区二区| 中文字幕高清一区| 欧美性色欧美a在线播放| 青青草国产成人av片免费| 久久先锋资源网| 97se亚洲国产综合在线| 天天综合色天天| 精品国产第一区二区三区观看体验| 国产成人在线视频播放| 亚洲精品免费在线| 精品乱人伦小说| 色综合色综合色综合色综合色综合|