using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ExampleCodeGenApp.Model.Compiler; namespace ExampleCodeGenApp.Model { public class InlineVariableDefinition : ITypedVariableDefinition { public string VariableName { get; private set; } public ITypedExpression Value { get; set; } public string Compile(CompilerContext context) { VariableName = context.FindFreeVariableName(); context.AddVariableToCurrentScope(this); return $"{VariableName} = {Value.Compile(context)}"; } } }