Fixed next.xsd and next.xml. Several Java classes were added
This commit is contained in:
parent
22ff4c7abe
commit
0bf0038112
263
next.xml
263
next.xml
@ -1,140 +1,175 @@
|
||||
<property name="DrawBounds" access="public" returnType="TinyRect">
|
||||
<?xml version = "1.0"?>
|
||||
|
||||
<property name="DrawBounds" access="public" returnType="TinyRect"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="next.xsd">
|
||||
<getter>
|
||||
<body>
|
||||
<statements>
|
||||
<variabledeclaration name="result" initialization="default(TinyRect)" />
|
||||
<variabledeclaration name="screenWidth" initialization="graphics.GraphicsDevice.Viewport.Width" />
|
||||
<variabledeclaration name="screenHeight" initialization="graphics.GraphicsDevice.Viewport.Height" />
|
||||
<variabledeclaration name="result" initialization="default(TinyRect)"/>
|
||||
<variabledeclaration name="screenWidth" initialization="graphics.GraphicsDevice.Viewport.Width"/>
|
||||
<variabledeclaration name="screenHeight" initialization="graphics.GraphicsDevice.Viewport.Height"/>
|
||||
<if>
|
||||
<condition>
|
||||
<binaryoperation operator="&&">
|
||||
<binaryoperation operator="==">
|
||||
<left>Env.PLATFORM</left>
|
||||
<right>Platform.Android</right>
|
||||
</binaryoperation>
|
||||
<binaryoperation operator=">">
|
||||
<left>screenHeight</left>
|
||||
<right>480</right>
|
||||
</binaryoperation>
|
||||
<left>
|
||||
<binaryoperation operator="==">
|
||||
<left>Env.PLATFORM</left>
|
||||
<right>Platform.Android</right>
|
||||
</binaryoperation>
|
||||
</left>
|
||||
<right>
|
||||
<binaryoperation operator=">">
|
||||
<left>screenHeight</left>
|
||||
<right>480</right>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</binaryoperation>
|
||||
</condition>
|
||||
<body>
|
||||
<assignment>
|
||||
<left>screenWidth</left>
|
||||
<right>
|
||||
<binaryoperation operator="*">
|
||||
<left>screenHeight</left>
|
||||
<binaryoperation operator="/">
|
||||
<left>640f</left>
|
||||
<right>480f</right>
|
||||
<statements>
|
||||
|
||||
<assignment>
|
||||
<left>screenWidth</left>
|
||||
<right>
|
||||
<binaryoperation operator="*">
|
||||
<left>screenHeight</left>
|
||||
<right>
|
||||
<binaryoperation operator="/">
|
||||
<left>640f</left>
|
||||
<right>480f</right>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</binaryoperation>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</assignment>
|
||||
</right>
|
||||
</assignment>
|
||||
|
||||
</statements>
|
||||
</body>
|
||||
</if>
|
||||
<if>
|
||||
<condition>
|
||||
<binaryoperation operator="&&">
|
||||
<binaryoperation operator="!=">
|
||||
<left>screenWidth</left>
|
||||
<right>0.0</right>
|
||||
</binaryoperation>
|
||||
<binaryoperation operator="!=">
|
||||
<left>screenHeight</left>
|
||||
<right>0.0</right>
|
||||
</binaryoperation>
|
||||
<left>
|
||||
<binaryoperation operator="!=">
|
||||
<left>screenWidth</left>
|
||||
<right>0.0</right>
|
||||
</binaryoperation>
|
||||
</left>
|
||||
<right>
|
||||
<binaryoperation operator="!=">
|
||||
<left>screenHeight</left>
|
||||
<right>0.0</right>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</binaryoperation>
|
||||
</condition>
|
||||
<body>
|
||||
<variabledeclaration name="num3" />
|
||||
<variabledeclaration name="num4" />
|
||||
<variabledeclaration name="test" />
|
||||
<assignment>
|
||||
<left>test</left>
|
||||
<right>
|
||||
<ternaryoperator>
|
||||
<condition>
|
||||
<binaryoperation operator="=="><left>1</left><right>1</right></binaryoperation>
|
||||
</condition>
|
||||
<iftrue>1</iftrue>
|
||||
<iffalse>2</iffalse>
|
||||
</ternaryoperator>
|
||||
</right>
|
||||
</assignment>
|
||||
<if>
|
||||
<condition>
|
||||
<binaryoperation operator="<">
|
||||
<binaryoperation operator="/">
|
||||
<left>screenWidth</left>
|
||||
<right>screenHeight</right>
|
||||
</binaryoperation>
|
||||
<right>1.3333333333333333</right>
|
||||
</binaryoperation>
|
||||
</condition>
|
||||
<body>
|
||||
<assignment>
|
||||
<left>num3</left>
|
||||
<right>640.0</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>num4</left>
|
||||
<right>
|
||||
<binaryoperation operator="*">
|
||||
<left>640.0</left>
|
||||
<binaryoperation operator="/">
|
||||
<left>screenHeight</left>
|
||||
<right>screenWidth</right>
|
||||
<statements>
|
||||
<variabledeclaration name="num3"/>
|
||||
<variabledeclaration name="num4"/>
|
||||
<variabledeclaration name="test"/>
|
||||
<assignment>
|
||||
<left>test</left>
|
||||
<right>
|
||||
<ternaryoperator>
|
||||
<condition>
|
||||
<binaryoperation operator="==">
|
||||
<left>1</left>
|
||||
<right>1</right>
|
||||
</binaryoperation>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</assignment>
|
||||
</body>
|
||||
</if>
|
||||
<else>
|
||||
<body>
|
||||
<assignment>
|
||||
<left>num3</left>
|
||||
<right>
|
||||
<binaryoperation operator="*">
|
||||
<left>480.0</left>
|
||||
</condition>
|
||||
<iftrue>1</iftrue>
|
||||
<iffalse>2</iffalse>
|
||||
</ternaryoperator>
|
||||
</right>
|
||||
</assignment>
|
||||
<if>
|
||||
<condition>
|
||||
<binaryoperation operator="<">
|
||||
<left>
|
||||
<binaryoperation operator="/">
|
||||
<left>screenWidth</left>
|
||||
<right>screenHeight</right>
|
||||
</binaryoperation>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>num4</left>
|
||||
<right>480.0</right>
|
||||
</assignment>
|
||||
</body>
|
||||
</else>
|
||||
<assignment>
|
||||
<left>result.LeftX</left>
|
||||
<right>0</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>result.RightX</left>
|
||||
<right>
|
||||
<typecast type="int">
|
||||
<value>num3</value>
|
||||
</typecast>
|
||||
</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>result.TopY</left>
|
||||
<right>0</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>result.BottomY</left>
|
||||
<right>
|
||||
<typecast type="int">
|
||||
<value>num4</value>
|
||||
</typecast>
|
||||
</right>
|
||||
</assignment>
|
||||
</left>
|
||||
<right>1.3333333333333333</right>
|
||||
</binaryoperation>
|
||||
</condition>
|
||||
<body>
|
||||
<statements>
|
||||
<assignment>
|
||||
<left>num3</left>
|
||||
<right>640.0</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>num4</left>
|
||||
<right>
|
||||
<binaryoperation operator="*">
|
||||
<left>640.0</left>
|
||||
<right>
|
||||
<binaryoperation operator="/">
|
||||
<left>screenHeight</left>
|
||||
<right>screenWidth</right>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</assignment>
|
||||
</statements>
|
||||
</body>
|
||||
<else>
|
||||
<body>
|
||||
<statements>
|
||||
<assignment>
|
||||
<left>num3</left>
|
||||
<right>
|
||||
<binaryoperation operator="*">
|
||||
<left>480.0</left>
|
||||
<right>
|
||||
<binaryoperation operator="/">
|
||||
<left>screenWidth</left>
|
||||
<right>screenHeight</right>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</binaryoperation>
|
||||
</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>num4</left>
|
||||
<right>480.0</right>
|
||||
</assignment>
|
||||
</statements>
|
||||
</body>
|
||||
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<assignment>
|
||||
<left>result.LeftX</left>
|
||||
<right>0</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>result.RightX</left>
|
||||
<right>
|
||||
<typecast type="int">
|
||||
<value>num3</value>
|
||||
</typecast>
|
||||
</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>result.TopY</left>
|
||||
<right>0</right>
|
||||
</assignment>
|
||||
<assignment>
|
||||
<left>result.BottomY</left>
|
||||
<right>
|
||||
<typecast type="int">
|
||||
<value>num4</value>
|
||||
</typecast>
|
||||
</right>
|
||||
</assignment>
|
||||
</statements>
|
||||
</body>
|
||||
</if>
|
||||
<return>
|
||||
|
51
next.xsd
51
next.xsd
@ -3,7 +3,8 @@
|
||||
<xs:element name="property">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="getter" type="getterType"/>
|
||||
<xs:element name="getter" type="getterType" minOccurs="0"/>
|
||||
<xs:element name="setter" type="setterType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required"/>
|
||||
<xs:attribute name="access" type="xs:string" use="required"/>
|
||||
@ -11,12 +12,19 @@
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
|
||||
<xs:complexType name="getterType">
|
||||
<xs:sequence>
|
||||
<xs:element name="body" type="bodyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="setterType">
|
||||
<xs:sequence>
|
||||
<xs:element name="body" type="bodyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="bodyType">
|
||||
<xs:sequence>
|
||||
<xs:element name="statements" type="statementsType"/>
|
||||
@ -27,7 +35,6 @@
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="variabledeclaration" type="variableDeclarationType"/>
|
||||
<xs:element name="if" type="ifType"/>
|
||||
<xs:element name="else" type="elseType"/>
|
||||
<xs:element name="assignment" type="assignmentType"/>
|
||||
<xs:element name="return" type="returnType"/>
|
||||
<xs:element name="ternaryoperator" type="ternaryOperatorType"/>
|
||||
@ -43,6 +50,7 @@
|
||||
<xs:sequence>
|
||||
<xs:element name="condition" type="conditionType"/>
|
||||
<xs:element name="body" type="bodyType"/>
|
||||
<xs:element name="else" type="elseType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
@ -61,7 +69,7 @@
|
||||
<xs:complexType name="assignmentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="left" type="xs:string"/>
|
||||
<xs:element name="right" type="rightType"/>
|
||||
<xs:element name="right" type="expressionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
@ -75,10 +83,26 @@
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="expressionType" mixed="true">
|
||||
<xs:choice minOccurs="0">
|
||||
<xs:element name="binaryoperation" type="binaryOperationType"/>
|
||||
<xs:element name="typecast" type="typeCastType"/>
|
||||
<xs:element name="ternaryoperator" type="ternaryOperatorType"/>
|
||||
<xs:element name="value" type="xs:string"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="binaryOperandType" mixed="true">
|
||||
<xs:choice minOccurs="0">
|
||||
<xs:element name="expression" type="expressionType"/>
|
||||
<xs:element name="binaryoperation" type="binaryOperationType"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="binaryOperationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="left" type="xs:string"/>
|
||||
<xs:element name="right" type="xs:string"/>
|
||||
<xs:element name="left" type="binaryOperandType"/>
|
||||
<xs:element name="right" type="binaryOperandType"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="operator" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
@ -90,11 +114,20 @@
|
||||
<xs:attribute name="type" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ternaryOperatorType">
|
||||
<xs:complexType name="ternaryBranchType" mixed="true">
|
||||
<xs:choice minOccurs="0">
|
||||
<xs:element name="binaryoperation" type="binaryOperationType"/>
|
||||
<xs:element name="typecast" type="typeCastType"/>
|
||||
<xs:element name="expression" type="xs:string"/>
|
||||
<xs:element name="value" type="xs:string"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ternaryOperatorType" mixed="true">
|
||||
<xs:sequence>
|
||||
<xs:element name="condition" type="xs:string"/>
|
||||
<xs:element name="iftrue" type="rightType"/>
|
||||
<xs:element name="iffalse" type="rightType"/>
|
||||
<xs:element name="condition" type="conditionType"/>
|
||||
<xs:element name="iftrue" type="ternaryBranchType"/>
|
||||
<xs:element name="iffalse" type="ternaryBranchType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
|
5
src/main/java/com/openeggbert/next/ast/Access.java
Normal file
5
src/main/java/com/openeggbert/next/ast/Access.java
Normal file
@ -0,0 +1,5 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
public enum Access {
|
||||
PUBLIC, PROTECTED, PRIVATE, PACKAGE;
|
||||
}
|
9
src/main/java/com/openeggbert/next/ast/Assignment.java
Normal file
9
src/main/java/com/openeggbert/next/ast/Assignment.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Assignment extends Statement {
|
||||
private String left;
|
||||
private Expression right;
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
public class BinaryOperation extends Expression{
|
||||
}
|
11
src/main/java/com/openeggbert/next/ast/Body.java
Normal file
11
src/main/java/com/openeggbert/next/ast/Body.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Body {
|
||||
private List<Statement> statements;
|
||||
|
||||
}
|
11
src/main/java/com/openeggbert/next/ast/Else.java
Normal file
11
src/main/java/com/openeggbert/next/ast/Else.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Else {
|
||||
private Body body;
|
||||
|
||||
}
|
4
src/main/java/com/openeggbert/next/ast/Expression.java
Normal file
4
src/main/java/com/openeggbert/next/ast/Expression.java
Normal file
@ -0,0 +1,4 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
public class Expression {
|
||||
}
|
9
src/main/java/com/openeggbert/next/ast/Getter.java
Normal file
9
src/main/java/com/openeggbert/next/ast/Getter.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Getter {
|
||||
private Body body;
|
||||
|
||||
}
|
9
src/main/java/com/openeggbert/next/ast/If.java
Normal file
9
src/main/java/com/openeggbert/next/ast/If.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
import java.util.concurrent.locks.Condition;
|
||||
|
||||
public class If extends Statement {
|
||||
private Condition condition;
|
||||
private Body body;
|
||||
private Else elseBranch;
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
public enum PrimitiveType {
|
||||
INT, LONG, FLOAT, DOUBLE, STRING
|
||||
}
|
13
src/main/java/com/openeggbert/next/ast/Property.java
Normal file
13
src/main/java/com/openeggbert/next/ast/Property.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Property {
|
||||
private String name;
|
||||
private Access access;
|
||||
private String returnType;
|
||||
private Getter getter;
|
||||
private Setter setter;
|
||||
|
||||
}
|
9
src/main/java/com/openeggbert/next/ast/Setter.java
Normal file
9
src/main/java/com/openeggbert/next/ast/Setter.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Setter {
|
||||
private Body body;
|
||||
|
||||
}
|
4
src/main/java/com/openeggbert/next/ast/Statement.java
Normal file
4
src/main/java/com/openeggbert/next/ast/Statement.java
Normal file
@ -0,0 +1,4 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
public class Statement {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
public class TernaryOperator extends Expression{
|
||||
}
|
4
src/main/java/com/openeggbert/next/ast/TypeCast.java
Normal file
4
src/main/java/com/openeggbert/next/ast/TypeCast.java
Normal file
@ -0,0 +1,4 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
public class TypeCast extends Expression{
|
||||
}
|
5
src/main/java/com/openeggbert/next/ast/Value.java
Normal file
5
src/main/java/com/openeggbert/next/ast/Value.java
Normal file
@ -0,0 +1,5 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
public class Value extends Expression{
|
||||
private String string;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.openeggbert.next.ast;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VariableDeclaration extends Statement {
|
||||
private String name;
|
||||
private String initialization;
|
||||
}
|
Reference in New Issue
Block a user