public static LiteralExpressionSyntax CreateLiteralExpression(string variableType, string variableValue)
        {
            if (VariableTypeCheckerUtility.IsVariableBoolean(variableType))
            {
                return(SyntaxFactory.LiteralExpression(CreateLiteralExpressionSyntaxKind(variableType, variableValue)));
            }

            return(SyntaxFactory.LiteralExpression(
                       CreateLiteralExpressionSyntaxKind(variableType, variableValue),
                       CreateLiteralExpressionSyntaxToken(variableType, variableValue)));
        }
        /// <summary> Create a field initializer with new keyword. Example: IntReactiveProperty a = new IntReactiveProperty()</summary>
        private static EqualsValueClauseSyntax CreateNewFieldInitializer(FieldGenerationData data)
        {
            var arguments = SyntaxFactory.ArgumentList();

            if (!string.IsNullOrEmpty(data.m_InitializerValue) || VariableTypeCheckerUtility.IsVariableBoolean(data.m_VariableType))
            {
                arguments = arguments.AddArguments(SyntaxFactory.Argument(LiteralExpressionUtility.CreateLiteralExpression(data.m_VariableType, data.m_InitializerValue)));
            }

            return(SyntaxFactory.EqualsValueClause(SyntaxFactory.ObjectCreationExpression(
                                                       NameSyntaxUtility.GetNameSyntax(data.m_VariableType), arguments, null)));
        }
        private static SyntaxKind CreateLiteralExpressionSyntaxKind(string variableType, string initializerValue)
        {
            if (VariableTypeCheckerUtility.IsVariableNumeric(variableType))
            {
                return(SyntaxKind.NumericLiteralExpression);
            }
            else if (VariableTypeCheckerUtility.IsVariableString(variableType))
            {
                return(SyntaxKind.StringLiteralExpression);
            }
            else if (VariableTypeCheckerUtility.IsVariableBoolean(variableType))
            {
                return(initializerValue.Equals("true") ? SyntaxKind.TrueLiteralExpression : SyntaxKind.FalseLiteralExpression);
            }

            return(SyntaxKind.DefaultLiteralExpression);
        }