Пример #1
0
        string VisitTypeElements(CSScriptParser.Type_elementsContext context, out System.Type type)
        {
            CSScriptParser.Type_elementContext[] vartypes = context.type_element();
            int varLen = vartypes.Length;

            string currentTypeString = null;

            System.Type currentType = null;
            int         typeStart   = -1;

            for (int i = 0; i < varLen; ++i)
            {
                CSScriptParser.Type_elementContext next = vartypes[i];
                string name = next.NAME().GetText();
                currentTypeString = GetTypeString(vartypes, i + 1, typeStart);
                currentType       = ReflectionUtil.GetType(currentTypeString);
                if (typeStart == -1 && currentType != null)
                {
                    typeStart = i;
                }
            }

            type = currentType;
            return(currentTypeString);
        }
Пример #2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="CSScriptParser.type_elements"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitType_elements([NotNull] CSScriptParser.Type_elementsContext context)
 {
     return(VisitChildren(context));
 }