當前位置: 首頁>>代碼示例>>Java>>正文


Java ASTExpressionList類代碼示例

本文整理匯總了Java中com.fujitsu.vdmj.ast.expressions.ASTExpressionList的典型用法代碼示例。如果您正苦於以下問題:Java ASTExpressionList類的具體用法?Java ASTExpressionList怎麽用?Java ASTExpressionList使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ASTExpressionList類屬於com.fujitsu.vdmj.ast.expressions包,在下文中一共展示了ASTExpressionList類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readSimpleCallStatement

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
private ASTStatement readSimpleCallStatement()
	throws ParserException, LexException
{
	LexNameToken name =
		readNameToken("Expecting operation name in call statement");

	checkFor(Token.BRA, 2206, "Expecting '(' after call operation name");
	ASTExpressionList args = new ASTExpressionList();
	ExpressionReader er = getExpressionReader();

	if (lastToken().isNot(Token.KET))
	{
		args.add(er.readExpression());

		while (ignore(Token.COMMA))
		{
			args.add(er.readExpression());
		}
	}

   	checkFor(Token.KET, 2124, "Expecting ')' after args");

	return new ASTCallStatement(name, args);
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:25,代碼來源:StatementReader.java

示例2: ASTCallObjectStatement

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
public ASTCallObjectStatement(ASTObjectDesignator designator,
	LexNameToken classname, ASTExpressionList args)
{
	super(designator.location);

	this.designator = designator;
	this.classname = classname;
	this.fieldname = null;
	this.args = args;
	this.explicit = (classname.module != null);
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:12,代碼來源:ASTCallObjectStatement.java

示例3: readObjectCallStatement

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
private ASTStatement readObjectCallStatement()
throws ParserException, LexException
  {
ASTObjectDesignator designator = readObjectDesignator();

// All operation calls actually look like object apply designators,
// since they end with <name>([args]). So we unpick the apply
// designator to extract the operation name and args.

if (!(designator instanceof ASTObjectApplyDesignator))
{
	throwMessage(2064, "Expecting <object>.identifier(args) or name(args)");
}

ASTObjectApplyDesignator oad = (ASTObjectApplyDesignator)designator;
ASTExpressionList args = oad.args;

if (oad.object instanceof ASTObjectFieldDesignator)
{
	ASTObjectFieldDesignator ofd = (ASTObjectFieldDesignator)oad.object;
	
	if (ofd.classname != null)
	{
   		return new ASTCallObjectStatement(ofd.object, ofd.classname, args);
	}
	else
	{
   		return new ASTCallObjectStatement(ofd.object, ofd.fieldname, args);
	}
}
else if (oad.object instanceof ASTObjectIdentifierDesignator)
{
	ASTObjectIdentifierDesignator oid = (ASTObjectIdentifierDesignator)oad.object;
	return new ASTCallStatement(oid.name, args);
}
else
{
	throwMessage(2065, "Expecting <object>.name(args) or name(args)");
	return null;
}
  }
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:42,代碼來源:StatementReader.java

示例4: readObjectDesignator

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
private ASTObjectDesignator readObjectDesignator()
	throws ParserException, LexException
{
	ASTObjectDesignator des = readSimpleObjectDesignator();
	boolean done = false;

	while (!done)
	{
		switch (lastToken().type)
		{
			case POINT:
				LexToken field = nextToken();

				// If we just read a qualified name, we're dealing with
				// something like new A().X`op(), else it's the more usual
				// new A().op().

				switch (field.type)
				{
					case IDENTIFIER:
						des = new ASTObjectFieldDesignator(des, (LexIdentifierToken)field);
						break;

					case NAME:
						des = new ASTObjectFieldDesignator(des, (LexNameToken)field);
						break;

					default:
						throwMessage(2066, "Expecting object field name");
				}

				nextToken();
				break;

			case BRA:
				nextToken();
		    	ExpressionReader er = getExpressionReader();
		    	ASTExpressionList args = new ASTExpressionList();

		    	if (lastToken().isNot(Token.KET))
		    	{
		    		args.add(er.readExpression());

		    		while (ignore(Token.COMMA))
		    		{
		    			args.add(er.readExpression());
		    		}
		    	}

		    	checkFor(Token.KET, 2124, "Expecting ')' after args");
				des = new ASTObjectApplyDesignator(des, args);
				break;

			default:
				done = true;
				break;
		}
	}

	return des;
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:62,代碼來源:StatementReader.java

示例5: readSimpleObjectDesignator

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
private ASTObjectDesignator readSimpleObjectDesignator()
	throws LexException, ParserException
{
	LexToken token = readToken();

	switch (token.type)
	{
		case SELF:
			return new ASTObjectSelfDesignator(token.location);

		case IDENTIFIER:
			return new ASTObjectIdentifierDesignator(idToName((LexIdentifierToken)token));

		case NAME:
			return new ASTObjectIdentifierDesignator((LexNameToken)token);

		case NEW:
			LexIdentifierToken name = readIdToken("Expecting class name after 'new'");
			checkFor(Token.BRA, 2207, "Expecting '(' after new class name");

	    	ASTExpressionList args = new ASTExpressionList();
	    	ExpressionReader er = getExpressionReader();

	    	if (lastToken().isNot(Token.KET))
	    	{
	    		args.add(er.readExpression());

	    		while (ignore(Token.COMMA))
	    		{
	    			args.add(er.readExpression());
	    		}
	    	}

	    	checkFor(Token.KET, 2124, "Expecting ')' after constructor args");
			return new ASTObjectNewDesignator(name, args);

		default:
			throwMessage(2067, "Expecting 'self', 'new' or name in object designator");
			break;
	}

	return null;
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:44,代碼來源:StatementReader.java

示例6: ASTSporadicStatement

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
public ASTSporadicStatement(LexNameToken opname, ASTExpressionList args)
{
	super(opname.location);
	this.opname = opname;
	this.args = args;
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:7,代碼來源:ASTSporadicStatement.java

示例7: ASTPeriodicStatement

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
public ASTPeriodicStatement(LexNameToken opname, ASTExpressionList args)
{
	super(opname.location);
	this.opname = opname;
	this.args = args;
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:7,代碼來源:ASTPeriodicStatement.java

示例8: ASTObjectApplyDesignator

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
public ASTObjectApplyDesignator(ASTObjectDesignator object, ASTExpressionList args)
{
	super(object.location);
	this.object = object;
	this.args = args;
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:7,代碼來源:ASTObjectApplyDesignator.java

示例9: ASTObjectNewDesignator

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
public ASTObjectNewDesignator(LexIdentifierToken classname, ASTExpressionList args)
{
	super(classname.location);
	this.expression = new ASTNewExpression(classname.location, classname, args);
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:6,代碼來源:ASTObjectNewDesignator.java

示例10: ASTCallStatement

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
public ASTCallStatement(LexNameToken name, ASTExpressionList args)
{
	super(name.location);
	this.name = name;
	this.args = args;
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:7,代碼來源:ASTCallStatement.java

示例11: TCExpressionList

import com.fujitsu.vdmj.ast.expressions.ASTExpressionList; //導入依賴的package包/類
public TCExpressionList(ASTExpressionList from) throws Exception
{
	super(from);
}
 
開發者ID:nickbattle,項目名稱:FJ-VDMJ,代碼行數:5,代碼來源:TCExpressionList.java


注:本文中的com.fujitsu.vdmj.ast.expressions.ASTExpressionList類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。