Пример #1
0
    public override void ExitVector3([NotNull] LanguageParser.Vector3Context context)
    {
        List <float> elements       = new List <float>();
        object       currentElement = stack.Pop();


        // Add all three floats of the vector3 to the list
        while (!currentElement.Equals(enter.EnterVector3))
        {
            elements.Add(Convert.ToSingle(currentElement));

            currentElement = stack.Pop();
        }

        // Push the vector3 to the stack
        // In reverse because we get them in reverse
        stack.Push(new Vector3(elements[2], elements[1], elements[0]));
    }
Пример #2
0
 /// <summary>
 /// Enter a parse tree produced by <see cref="LanguageParser.vector3"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void EnterVector3([NotNull] LanguageParser.Vector3Context context)
 {
 }
Пример #3
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="LanguageParser.vector3"/>.
 /// <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 VisitVector3([NotNull] LanguageParser.Vector3Context context)
 {
     return(VisitChildren(context));
 }
Пример #4
0
    //******************************************************************************************************

    //--------------------------------------------------------------------------------------------------------------------

    //******************************************************************************************************


    public override void EnterVector3([NotNull] LanguageParser.Vector3Context context)
    {
        stack.Push(enter.EnterVector3);
    }