Пример #1
0
        //public override void ResetOnAcquire()
        //{
        //    base.ResetOnAcquire();

        //    _generatedStructure = null;
        //}


        private void translate_Identifier_Declaration(ParseTreeNode node)
        {
            try
            {
                Context.MarkCheckPointState();

                //Read the name of the member
                var identifierName = TranslateChildSymbolName(_generatedStructure, node.ChildNodes[0]);

                //Read the type of the member
                var identifierType = GMacValueAccessGenerator.Translate_Direct_LanguageType(Context, node.ChildNodes[1]);

                //Create the member in the symbol table
                _generatedStructure.DefineReadWriteDataMember(identifierName, identifierType);

                Context.UnmarkCheckPointState();
                Context.CompilationLog.ReportNormal("Translated Structure Member: " + identifierName, ProgressEventArgsResult.Success);
            }
            catch (CompilerException)
            {
                Context.RestoreToCheckPointState();
                Context.CompilationLog.ReportNormal("Translate Structure Member Failed: " + _generatedStructure.SymbolAccessName, ProgressEventArgsResult.Failure);
            }
            catch (Exception e)
            {
                Context.RestoreToCheckPointState();
                Context.CompilationLog.ReportError("Translate Structure Member Failed:" + _generatedStructure.SymbolAccessName, e);
            }
        }
        private List <GMacFrame> translate_Frames_List(ParseTreeNode node)
        {
            var framesList = new List <GMacFrame>(node.ChildNodes.Count);

            foreach (var subnode in node.ChildNodes)
            {
                try
                {
                    Context.MarkCheckPointState();

                    var frame =
                        (GMacFrame)GMacValueAccessGenerator.Translate_Direct(Context, subnode, RoleNames.Frame);

                    framesList.Add(frame);

                    Context.UnmarkCheckPointState();
                }
                catch (CompilerException)
                {
                    Context.RestoreToCheckPointState();
                }
                catch (Exception e)
                {
                    Context.RestoreToCheckPointState();
                    throw (new Exception("Unhandled Exception", e));
                }
            }

            return(framesList);
        }
Пример #3
0
        private ILanguageExpression translate_Expression_Scoped(ParseTreeNode node)
        {
            var frame =
                (GMacFrame)GMacValueAccessGenerator.Translate_Direct(Context, node.ChildNodes[0], RoleNames.Frame);

            Context.OpenScope(frame);

            var expr = GMacExpressionGenerator.Translate(Context, node.ChildNodes[1]);

            Context.CloseScope(frame);

            return(expr);
        }
Пример #4
0
        private CommandDeclareVariable translate_Identifier_Declaration(ParseTreeNode node)
        {
            //Read the name of the member
            var identifierName = GenUtils.Translate_Identifier(node.ChildNodes[0]);

            if (Context.ActiveParentScope.SymbolExists(identifierName))
            {
                return(CompilationLog.RaiseGeneratorError <CommandDeclareVariable>("Identifier name already used", node.ChildNodes[0]));
            }

            var identifierType = GMacValueAccessGenerator.Translate_Direct_LanguageType(Context, node.ChildNodes[1]);

            return(translate_Declare(identifierName, identifierType));
        }
Пример #5
0
        ///Set the signature of the current frame to a reciprocal frame
        private GaFrame translate_Frame_Signature_Reciprocal(ParseTreeNode node)
        {
            var baseFrame =
                (GMacFrame)GMacValueAccessGenerator.Translate_Direct(Context, node.ChildNodes[0], RoleNames.Frame);

            if (baseFrame.VSpaceDimension != _vSpaceDim)
            {
                CompilationLog.RaiseGeneratorError <int>("Base frame must be of dimension " + _vSpaceDim, node.ChildNodes[0]);
            }

            _baseFrame = baseFrame;

            var derivedFrameSystem = GaFrame.CreateReciprocalCbmFrameSystem(baseFrame.AssociatedSymbolicFrame);

            return(derivedFrameSystem.DerivedFrame);
        }
Пример #6
0
        //public static bool TryTranslate_LValue(GMacSymbolTranslatorContext context, ParseTreeNode node, out LanguageValueAccess varAccess)
        //{
        //    var qualList = GenUtils.Translate_Qualified_Identifier(node);

        //    LanguageSymbol symbol;

        //    var flag =
        //        context
        //        .OpenedDistinctScopes()
        //        .LookupSymbol(qualList.FirstItem, out symbol);

        //    if (flag == false || (symbol is SymbolLValue) == false)
        //    {
        //        varAccess = null;
        //        return false;
        //    }

        //    varAccess = LanguageValueAccess.Create(symbol);

        //    return true;
        //}

        public static LanguageValueAccess Translate(GMacSymbolTranslatorContext context, ParseTreeNode node, bool isLvalue, TrimmedList <string> qualList)
        {
            context.PushState(node);

            var translator = new GMacValueAccessGenerator();//new GMacValueAccessGenerator(qualList, context, isLvalue, true);

            translator.SetContext(qualList, context, isLvalue, true);
            translator.Translate();

            context.PopState();

            var result = translator._generatedValueAccess;

            //MasterPool.Release(translator);

            return(result);
        }
        //public override void ResetOnAcquire()
        //{
        //    base.ResetOnAcquire();

        //    _generatedExpression = null;
        //}


        //public GMacExpressionBasicGenerator BasicExpressionGenerator { get; private set; }


        //private GMacExpressionCompositeGenerator(GMacSymbolTranslatorContext context)
        //    : base(context)
        //{
        //    //BasicExpressionGenerator = new GMacExpressionBasicGenerator(context);
        //}

        //private GMacExpressionCompositeGenerator(GMacExpressionBasicGenerator basic_expr_gen)
        //    : base(basic_expr_gen.Context)
        //{
        //    BasicExpressionGenerator = basic_expr_gen;
        //}


        private SymbolLocalVariable translate_Identifier_Declaration(ParseTreeNode node)
        {
            //Read the name of the member
            var identifierName = GenUtils.Translate_Identifier(node.ChildNodes[0]);

            if (Context.ActiveParentScope.SymbolExists(identifierName))
            {
                return(CompilationLog.RaiseGeneratorError <SymbolLocalVariable>("Identifier name already used", node.ChildNodes[0]));
            }

            var identifierType = GMacValueAccessGenerator.Translate_Direct_LanguageType(Context, node.ChildNodes[1]);

            //Create the member in the symbol table
            return
                (Context
                 .ActiveParentCompositeExpression
                 .DefineLocalVariable(identifierName, identifierType)
                 .LocalVariable);
        }
Пример #8
0
        //protected void SetContext(GMacSymbolTranslatorContext context)
        //{
        //    this.SetContext((SymbolTranslatorContext)context);
        //}

        /// <summary>
        /// Take a qualified indetifier node and separate it into a parent symbol and a child symbol name
        /// </summary>
        /// <param name="node"></param>
        /// <param name="parentSymbol"></param>
        /// <param name="childSymbolName"></param>
        protected bool Translate_ParentSymbolAndChildSymbolName(ParseTreeNode node, out SymbolWithScope parentSymbol, out string childSymbolName)
        {
            var qualList = GenUtils.Translate_Qualified_Identifier(node);

            childSymbolName = qualList.LastItem;

            if (qualList.ActiveLength == 1)
            {
                parentSymbol = Context.ActiveParentSymbol;
            }

            else
            {
                qualList.DecreaseActiveEndOffset();

                parentSymbol = GMacValueAccessGenerator.Translate_Direct(Context, node, qualList) as SymbolWithScope;
            }

            return(ReferenceEquals(parentSymbol, null) == false);
        }
Пример #9
0
        private LanguageValueAccess translate_Command_Let_LHS_Qualified_Item(ILanguageType rhsType, ParseTreeNode node)
        {
            node.Assert(GMacParseNodeNames.QualifiedItem);

            var subNode = node.ChildNodes[0];

            switch (subNode.ToString())
            {
            case GMacParseNodeNames.QualifiedBasisBladesSet:
            case GMacParseNodeNames.QualifiedBasisBladeCoefficient:
                return(GMacValueAccessGenerator.Translate(Context, subNode, true));

            case GMacParseNodeNames.QualifiedIdentifier:
                if (subNode.ChildNodes.Count == 1)
                {
                    LanguageValueAccess varAccess;
                    var flag = TryTranslate_LValue(Context, subNode, out varAccess);

                    if (flag)
                    {
                        return(varAccess);
                    }

                    var identifierName = subNode.ChildNodes[0].FindTokenAndGetText();

                    if (Context.ActiveParentScope.SymbolExists(identifierName))
                    {
                        CompilationLog.RaiseGeneratorError <LanguageValueAccess>("Identifier name already used", node.ChildNodes[0]);
                    }

                    var declareCommand = translate_Declare(identifierName, rhsType);

                    return(LanguageValueAccess.Create(declareCommand.DataStore));
                }

                return(GMacValueAccessGenerator.Translate(Context, subNode, true));

            default:
                return(CompilationLog.RaiseGeneratorError <LanguageValueAccess>("Unknown LHS node!!", node));
            }
        }
Пример #10
0
        public static LanguageValueAccess Translate_LValue_MacroParameter(GMacSymbolTranslatorContext context, ParseTreeNode node, GMacMacro macro)
        {
            context.PushState(macro.ChildSymbolScope, node);

            var translator = new GMacValueAccessGenerator();//new GMacValueAccessGenerator(context, true, false);

            translator.SetContext(context, true, false);
            translator.Translate();

            context.PopState();

            if (translator._generatedValueAccess.RootSymbol is SymbolProcedureParameter)
            {
                var result = translator._generatedValueAccess;

                //MasterPool.Release(translator);

                return(result);
            }

            return(context.CompilationLog.RaiseGeneratorError <LanguageValueAccess>("Expecting a macro parameter", node));
        }
Пример #11
0
        //private ILanguageExpression translate_Expression_Cast(ParseTreeNode node)
        //{
        //    var langType = GMacValueAccessGenerator.Translate_Direct_LanguageType(this.Context, node.ChildNodes[0]);

        //    var expr = GMacExpressionGenerator.Translate(this.BasicExpressionGenerator, node.ChildNodes[0]);

        //    return this.BasicExpressionGenerator.Generate_TypeCast(langType, expr);
        //}

        protected override void Translate()
        {
            var subNode = RootParseNode.ChildNodes[0];

            switch (subNode.Term.Name)
            {
            case GMacParseNodeNames.ConstantNumber:
                _generatedExpression = translate_Constant_Number(subNode);
                break;

            case GMacParseNodeNames.ExpressionScoped:
                _generatedExpression = translate_Expression_Scoped(subNode);
                break;

            case GMacParseNodeNames.QualifiedItem:
                _generatedExpression = GMacValueAccessGenerator.Translate(Context, subNode.ChildNodes[0], false);
                break;

            case GMacParseNodeNames.ExpressionBracketed:
                _generatedExpression = GMacExpressionGenerator.Translate(BasicExpressionGenerator, subNode.ChildNodes[0]);
                break;

            case GMacParseNodeNames.StringLiteral:
                _generatedExpression = GMacExpressionAtomicSymbolicGenerator.Translate(Context, subNode);
                break;

            case GMacParseNodeNames.ExpressionComposite:
                _generatedExpression = GMacExpressionCompositeGenerator.Translate(Context, subNode);
                break;

            case GMacParseNodeNames.ExpressionFunction:
                _generatedExpression = GMacExpressionAtomicFunctionGenerator.Translate(BasicExpressionGenerator, subNode);
                break;

            default:
                CompilationLog.RaiseGeneratorError <ILanguageExpression>("Expression not recognized", RootParseNode);
                break;
            }
        }
Пример #12
0
        ///Set the signature of the current frame to a base frame with a change of basis matrix
        private GaFrame translate_Frame_Signature_CBM(ParseTreeNode node)
        {
            var baseFrame =
                (GMacFrame)GMacValueAccessGenerator.Translate_Direct(Context, node.ChildNodes[0], RoleNames.Frame);

            if (baseFrame.VSpaceDimension != _vSpaceDim)
            {
                CompilationLog.RaiseGeneratorError <int>("Base frame must be of dimension " + _vSpaceDim, node.ChildNodes[0]);
            }

            var cbmMatrix = MathematicaMatrix.Create(Cas, GenUtils.Translate_StringLiteral(node.ChildNodes[1]));

            if (cbmMatrix.IsInvertable() == false || cbmMatrix.Rows != _vSpaceDim)
            {
                CompilationLog.RaiseGeneratorError <int>("Expecting a square invertable matrix with " + _vSpaceDim + " rows", node.ChildNodes[1]);
            }

            _baseFrame = baseFrame;

            var derivedFrameSystem = GaFrame.CreateDerivedCbmFrameSystem(baseFrame.AssociatedSymbolicFrame, cbmMatrix);

            return(derivedFrameSystem.DerivedFrame);
        }
Пример #13
0
        private void translate_Macro_OutputType(ParseTreeNode node)
        {
            try
            {
                Context.MarkCheckPointState();

                var macroOutputType = GMacValueAccessGenerator.Translate_Direct_LanguageType(Context, node);

                _generatedMacro.DefineOutputParameter(GeneralConstants.MacroOutputParameterName, macroOutputType);

                Context.UnmarkCheckPointState();
                Context.CompilationLog.ReportNormal("Translated Macro Output Type: " + _generatedMacro.SymbolAccessName, ProgressEventArgsResult.Success);
            }
            catch (CompilerException)
            {
                Context.RestoreToCheckPointState();
                Context.CompilationLog.ReportNormal("Translate Macro Output Type: " + _generatedMacro.SymbolAccessName, ProgressEventArgsResult.Failure);
            }
            catch (Exception e)
            {
                Context.RestoreToCheckPointState();
                Context.CompilationLog.ReportError("Translate Macro Output Type Failed: " + _generatedMacro.SymbolAccessName, e);
            }
        }
        private ILanguageExpression translate_Expression_Function_Macro(GMacMacro macro, ParseTreeNode node)
        {
            var operands = OperandsByValueAccess.Create();

            if (node.ChildNodes.Count == 0)
            {
                return(BasicPolyadic.Create(macro.OutputParameterType, macro, operands));
            }

            var expressionFunctionInputsNode = node.ChildNodes[0];

            var subNode = expressionFunctionInputsNode.ChildNodes[0];

            switch (subNode.Term.ToString())
            {
            case GMacParseNodeNames.ExpressionFunctionInputsAssignments:
                var expressionFunctionInputsAssignmentsNode = subNode;

                foreach (var nodeExpressionFunctionInputsAssignmentsItem in expressionFunctionInputsAssignmentsNode.ChildNodes)
                {
                    var lhsNode = nodeExpressionFunctionInputsAssignmentsItem.ChildNodes[0].ChildNodes[0];
                    var rhsNode = nodeExpressionFunctionInputsAssignmentsItem.ChildNodes[1];

                    var lhsValAccess = GMacValueAccessGenerator.Translate_LValue_MacroParameter(Context, lhsNode, macro);

                    var rhsExpr =
                        BasicExpressionGenerator.Generate_PolyadicOperand(
                            lhsValAccess.ExpressionType,
                            GMacExpressionGenerator.Translate(BasicExpressionGenerator, rhsNode)
                            );

                    operands.AddOperand(lhsValAccess, rhsExpr);
                }

                break;

            case GMacParseNodeNames.ExpressionFunctionInputsExpressions:
                var nodeExpressionFunctionInputsExpressions = subNode;

                var i = -1;
                foreach (var parameter in macro.Parameters)
                {
                    if (i >= nodeExpressionFunctionInputsExpressions.ChildNodes.Count)
                    {
                        break;
                    }

                    //The first parameter of any macro is the 'result' output parameter; ignore it
                    if (i >= 0)
                    {
                        var rhsNode = nodeExpressionFunctionInputsExpressions.ChildNodes[i];

                        var lhsValAccess = LanguageValueAccess.Create(parameter);

                        var rhsExpr =
                            BasicExpressionGenerator.Generate_PolyadicOperand(
                                lhsValAccess.ExpressionType,
                                GMacExpressionGenerator.Translate(BasicExpressionGenerator, rhsNode)
                                );

                        operands.AddOperand(lhsValAccess, rhsExpr);
                    }

                    i = i + 1;
                }

                if (nodeExpressionFunctionInputsExpressions.ChildNodes.Count > i)
                {
                    return(CompilationLog.RaiseGeneratorError <ILanguageExpression>("Expecting a list of at most " + i + " expression as input to the macro call", node));
                }

                break;

            default:
                return(CompilationLog.RaiseGeneratorError <ILanguageExpression>("Expecting a list of expressions or list of parameter assignments as input to the macro call", node));
            }

            return(BasicPolyadic.Create(macro.OutputParameterType, macro, operands));
        }
        private ILanguageExpression translate_Expression_Function(ParseTreeNode node)
        {
            var expr = translate_TryBuiltinMacro(node);

            if (expr != null)
            {
                return(expr);
            }

            var nodeQualifiedIdentifier = node.ChildNodes[0];

            var nodeDefaultValueOpt = node.ChildNodes[1];

            var nodeInputsOpt = node.ChildNodes[2];

            ILanguageExpressionAtomic defaultValueSource;

            var symbol = GMacValueAccessGenerator.Translate_Direct(Context, nodeQualifiedIdentifier);

            var macro = symbol as GMacMacro;

            if (macro != null)
            {
                return
                    (nodeDefaultValueOpt.ChildNodes.Count == 0
                    ? translate_Expression_Function_Macro(macro, nodeInputsOpt)
                    : CompilationLog.RaiseGeneratorError <ILanguageExpression>("A default value cannot be used for a macro call operation", nodeDefaultValueOpt));
            }

            var structure = symbol as GMacStructure;

            if (structure != null)
            {
                if (nodeDefaultValueOpt.ChildNodes.Count <= 0)
                {
                    return(translate_Expression_Function_Structure(structure, null,
                                                                   nodeInputsOpt));
                }

                var nodeDefaultValue = nodeDefaultValueOpt.ChildNodes[0];

                defaultValueSource =
                    BasicExpressionGenerator.Generate_PolyadicOperand(
                        structure,
                        GMacExpressionGenerator.Translate(BasicExpressionGenerator, nodeDefaultValue.ChildNodes[0])
                        );

                return(translate_Expression_Function_Structure(structure, defaultValueSource, nodeInputsOpt));
            }

            var subspace = symbol as GMacFrameSubspace;

            if (subspace != null)
            {
                if (nodeDefaultValueOpt.ChildNodes.Count <= 0)
                {
                    return(translate_Expression_Function_Subspace(subspace, null, nodeInputsOpt));
                }

                var nodeDefaultValue = nodeDefaultValueOpt.ChildNodes[0];

                defaultValueSource =
                    BasicExpressionGenerator.Generate_PolyadicOperand(
                        subspace.ParentFrame.MultivectorType,
                        GMacExpressionGenerator.Translate(BasicExpressionGenerator, nodeDefaultValue.ChildNodes[0])
                        );

                return(translate_Expression_Function_Subspace(subspace, defaultValueSource, nodeInputsOpt));
            }

            var multivector = symbol as GMacFrameMultivector;

            if (multivector != null)
            {
                if (nodeDefaultValueOpt.ChildNodes.Count <= 0)
                {
                    return(translate_Expression_Function_MultivectorType(multivector,
                                                                         null, nodeInputsOpt));
                }

                var nodeDefaultValue = nodeDefaultValueOpt.ChildNodes[0];

                defaultValueSource =
                    BasicExpressionGenerator.Generate_PolyadicOperand(
                        multivector,
                        GMacExpressionGenerator.Translate(BasicExpressionGenerator, nodeDefaultValue.ChildNodes[0])
                        );

                return(translate_Expression_Function_MultivectorType(multivector, defaultValueSource, nodeInputsOpt));
            }

            var typePrimitive = symbol as TypePrimitive;

            if (typePrimitive != null)
            {
                return
                    (nodeDefaultValueOpt.ChildNodes.Count == 0
                    ? translate_Expression_Function_Cast(typePrimitive, nodeInputsOpt)
                    : CompilationLog.RaiseGeneratorError <ILanguageExpression>("A default value cannot be used for a type cast operation", nodeDefaultValueOpt));
            }

            var transform = symbol as GMacMultivectorTransform;

            if (transform != null)
            {
                return
                    (nodeDefaultValueOpt.ChildNodes.Count == 0
                    ? translate_Expression_Function_Transform(transform, nodeInputsOpt)
                    : CompilationLog.RaiseGeneratorError <ILanguageExpression>("A default value cannot be used for a multivector transform operation", nodeDefaultValueOpt));
            }

            return(CompilationLog.RaiseGeneratorError <ILanguageExpression>("Expecting a macro, structure, transform, or multivector class", node));
        }
        private ILanguageExpression translate_Expression_Function_Structure(GMacStructure structure, ILanguageExpressionAtomic defaultValueSource, ParseTreeNode node)
        {
            var operands = OperandsByValueAccess.Create();

            if (node.ChildNodes.Count == 0)
            {
                return
                    (defaultValueSource == null
                    ? structure.CreateConstructorExpression(operands)
                    : structure.CreateConstructorExpression(defaultValueSource, operands));
            }

            var expressionFunctionInputsNode = node.ChildNodes[0];

            var subNode = expressionFunctionInputsNode.ChildNodes[0];

            switch (subNode.Term.ToString())
            {
            case GMacParseNodeNames.ExpressionFunctionInputsAssignments:
                var expressionFunctionInputsAssignmentsNode = subNode;

                foreach (var nodeExpressionFunctionInputsAssignmentsItem in expressionFunctionInputsAssignmentsNode.ChildNodes)
                {
                    var lhsNode = nodeExpressionFunctionInputsAssignmentsItem.ChildNodes[0].ChildNodes[0];
                    var rhsNode = nodeExpressionFunctionInputsAssignmentsItem.ChildNodes[1];

                    var lhsValAccess = GMacValueAccessGenerator.Translate_LValue_StructureMember(Context, lhsNode, structure);

                    var rhsExpr =
                        BasicExpressionGenerator.Generate_PolyadicOperand(
                            lhsValAccess.ExpressionType,
                            GMacExpressionGenerator.Translate(BasicExpressionGenerator, rhsNode)
                            );

                    operands.AddOperand(lhsValAccess, rhsExpr);
                }

                break;

            case GMacParseNodeNames.ExpressionFunctionInputsExpressions:
                var expressionFunctionInputsExpressionsNode = subNode;

                var i = 0;

                foreach (var dataMember in structure.DataMembers)
                {
                    if (i >= expressionFunctionInputsExpressionsNode.ChildNodes.Count)
                    {
                        break;
                    }

                    var rhsNode = expressionFunctionInputsExpressionsNode.ChildNodes[i];

                    var lhsValAccess = LanguageValueAccess.Create(dataMember);

                    var rhsExpr =
                        BasicExpressionGenerator.Generate_PolyadicOperand(
                            lhsValAccess.ExpressionType,
                            GMacExpressionGenerator.Translate(BasicExpressionGenerator, rhsNode)
                            );

                    operands.AddOperand(lhsValAccess, rhsExpr);

                    i = i + 1;
                }

                if (expressionFunctionInputsExpressionsNode.ChildNodes.Count > i)
                {
                    return(CompilationLog.RaiseGeneratorError <ILanguageExpression>("Expecting a list of at most " + i + " expression as input to the structure construction", node));
                }

                break;

            default:
                return(CompilationLog.RaiseGeneratorError <ILanguageExpression>("Expecting a list of expressions or a list of member assignments as input to the structure construction", node));
            }

            return
                (defaultValueSource == null
                ? structure.CreateConstructorExpression(operands)
                : structure.CreateConstructorExpression(defaultValueSource, operands));
        }
Пример #17
0
        private void translate_GMacDSL_Items_List(ParseTreeNode node)
        {
            if (CompilationLog.HasErrors && CompilationLog.StopOnFirstError)
            {
                return;
            }

            var subnode = node.ChildNodes[0];

            if (_translateNamespaceFirst && subnode.Term.ToString() != GMacParseNodeNames.Namespace)
            {
                CompilationLog.RaiseGeneratorError <int>("DSL definitions must start with a namespace", subnode);
            }

            _translateNamespaceFirst = false;

            switch (subnode.Term.ToString())
            {
            case GMacParseNodeNames.Breakpoint:
                GMacRootAst.EnableBreakpoints = true;
                break;

            case GMacParseNodeNames.Namespace:
                GMacNamespaceGenerator.Translate(Context, subnode);
                break;

            case GMacParseNodeNames.OpenNamespace:
                //Only namespaces and frames can be used in the 'open' statement
                Context.OpenScope(
                    (SymbolWithScope)GMacValueAccessGenerator.Translate_Direct(
                        Context,
                        subnode.ChildNodes[0],
                        new[] { RoleNames.Namespace, RoleNames.Frame }
                        )
                    );

                break;

            case GMacParseNodeNames.Frame:
                GMacFrameGenerator.Translate(Context, subnode);
                break;

            case GMacParseNodeNames.Constant:
                GMacConstantGenerator.Translate(Context, subnode);
                break;

            case GMacParseNodeNames.Structure:
                GMacStructureGenerator.Translate(Context, subnode);
                break;

            case GMacParseNodeNames.Transform:
                GMacTransformGenerator.Translate(Context, subnode);
                break;

            case GMacParseNodeNames.Macro:
                GMacMacroGenerator.Translate(Context, subnode);
                break;

            case GMacParseNodeNames.MacroTemplate:
                GMacMacroTemplateGenerator.Translate(Context, subnode);
                break;

            case GMacParseNodeNames.TemplatesImplementation:
                GMacTemplatesImplementationGenerator.Translate(Context, subnode);
                break;

            default:
                CompilationLog.RaiseGeneratorError <int>("DSL definitions item not recognized", subnode);
                break;
            }
        }