⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 standard.xml

📁 中山大学编译原理课程的一个实验
💻 XML
字号:
<?xml version="1.0"?>
<!-- Standard test cases for EvalExpr -->
<test-case-definitions>

<test-case>
	<id>C001</id>
	<description>A simple expression.</description>
	<input>9 - 3 * 2</input>
	<output>3</output>
</test-case>

<test-case>
	<id>C002</id>
	<description>Expression with arithmetic operations.</description>
	<input>2.25E+2 - (55.5 + 4 * (10 / 2) ^ 2)</input>
	<output>69.5</output>
</test-case>

<test-case>
	<id>C003</id>
	<description>Expression with arithmetic operations.</description>
	<input>65 / 5 - 130e-1</input>
	<output>0.0</output>
</test-case>

<test-case>
	<id>C004</id>
	<description>Expression with relational and logical operations.</description>
	<input><![CDATA[(5 > 3) & (4 < 8) ? 15 : 16]]></input>
	<output>15</output>
</test-case>

<test-case>
	<id>C005</id>
	<description>Predefined functions.</description>
	<input>max(sin(0.15), cos(0.15), sin(cos(0.15)))</input>
	<output>0.98877</output>
</test-case>

<test-case>
	<id>C006</id>
	<description>Predefined functions.</description>
	<input>sin(min(12, 3 * 5, 2 + 3 ^ 2, 3.14E2))</input>
	<output>-0.99999</output>
</test-case>

<test-case>
	<id>E001</id>
	<description>Left parenthesis expected.</description>
	<input>(2 + 3) ^ 3) - ((1 + 1)</input>
	<exception>MissingLeftParenthesisException</exception>
</test-case>

<test-case>
	<id>E002</id>
	<description>Right parenthesis expected.</description>
	<input>((2 + 3) ^ ((3 - 1) + 1)</input>
	<exception>MissingRightParenthesisException</exception>
</test-case>

<test-case>
	<id>E003</id>
	<description>Operator expected.</description>
	<input>(1 + 2) ^ (3 - 4)  5</input>
	<exception>MissingOperatorException</exception>
</test-case>

<test-case>
	<id>E004</id>
	<description>Operand expected.</description>
	<input>(1 + 2) ^ (3 - ) + 5</input>
	<exception>MissingOperandException</exception>
</test-case>

<test-case>
	<id>E005</id>
	<description>Divided by 0.</description>
	<input>4 / (12 - 3 * 4) + 1</input>
	<exception>DividedByZeroException</exception>
</test-case>

<test-case>
	<id>E006</id>
	<description>Type mismatched.</description>
	<input><![CDATA[(13 < 2 * 5) + 12]]></input>
	<exception>TypeMismatchedException</exception>
</test-case>

<test-case>
	<id>E007</id>
	<description>Scientific Notation Error.</description>
	<input>4 + 10.E+5 + 1</input>
	<exception>IllegalDecimalException</exception>
</test-case>

<test-case>
	<id>E008</id>
	<description>Not a predefined identifier.</description>
	<input>4 + mix(5, 2) + 1</input>
	<exception>IllegalIdentifierException</exception>
</test-case>

<test-case>
	<id>E009</id>
	<description>Function call error.</description>
	<input>sin(2, 1)</input>
	<exception>FunctionCallException</exception>
</test-case>

<test-case>
	<id>E010</id>
	<description>Function call error.</description>
	<input>min(2.5)</input>
	<exception>MissingOperandException</exception>
</test-case>

</test-case-definitions>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -