コード例 #1
0
 public ExpressionSyntax Transpile(IExpressionSyntax expression)
 {
     return(expression switch
     {
         JassCharacterLiteralExpressionSyntax characterLiteralExpression => Transpile(characterLiteralExpression),
         JassFourCCLiteralExpressionSyntax fourCCLiteralExpression => Transpile(fourCCLiteralExpression),
         JassHexadecimalLiteralExpressionSyntax hexadecimalLiteralExpression => Transpile(hexadecimalLiteralExpression),
         JassRealLiteralExpressionSyntax realLiteralExpression => Transpile(realLiteralExpression),
         JassOctalLiteralExpressionSyntax octalLiteralExpression => Transpile(octalLiteralExpression),
         JassDecimalLiteralExpressionSyntax decimalLiteralExpression => Transpile(decimalLiteralExpression),
         JassBooleanLiteralExpressionSyntax booleanLiteralExpression => Transpile(booleanLiteralExpression),
         JassStringLiteralExpressionSyntax stringLiteralExpression => Transpile(stringLiteralExpression),
         JassNullLiteralExpressionSyntax nullLiteralExpression => Transpile(nullLiteralExpression),
         JassFunctionReferenceExpressionSyntax functionReferenceExpression => Transpile(functionReferenceExpression),
         JassInvocationExpressionSyntax invocationExpression => Transpile(invocationExpression),
         JassArrayReferenceExpressionSyntax arrayReferenceExpression => Transpile(arrayReferenceExpression),
         JassVariableReferenceExpressionSyntax variableReferenceExpression => Transpile(variableReferenceExpression),
         JassParenthesizedExpressionSyntax parenthesizedExpression => Transpile(parenthesizedExpression),
         JassUnaryExpressionSyntax unaryExpression => Transpile(unaryExpression),
         JassBinaryExpressionSyntax binaryExpression => Transpile(binaryExpression),
     });
コード例 #2
0
 public ExpressionSyntax Transpile(JassHexadecimalLiteralExpressionSyntax hexadecimalLiteralExpression)
 {
     return(SyntaxFactory.ParseExpression(hexadecimalLiteralExpression.ToString()));
 }
コード例 #3
0
 public void Render(JassHexadecimalLiteralExpressionSyntax hexadecimalLiteralExpression)
 {
     Write(hexadecimalLiteralExpression.ToString());
 }
コード例 #4
0
        public LuaExpressionSyntax Transpile(JassHexadecimalLiteralExpressionSyntax hexadecimalLiteralExpression, out JassTypeSyntax type)
        {
            type = JassTypeSyntax.Integer;

            return(hexadecimalLiteralExpression.ToString());
        }