Esempio n. 1
0
 /// <summary>
 /// Initializes the node after being parsed by the parser.
 /// </summary>
 /// <param name="primitive">Optional primitive API call to native code.</param>
 protected internal void SetContents(PrimitiveCallNode primitive)
 {
     this.Primitive = primitive; // null is OK here.
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes the node after being parsed by the parser.
 /// </summary>
 /// <param name="primitive">Optional primitive API call to native code.</param>
 protected internal void SetContents(PrimitiveCallNode primitive)
 {
     this.Primitive = primitive; // null is OK here.
 }
Esempio n. 3
0
        protected virtual PrimitiveCallNode ParseApiCall(MethodNode parent, BinarySelectorToken token)
        {
            PrimitiveCallNode result = new PrimitiveCallNode(parent);
            List<IPrimitiveCallParameterToken> parameters = new List<IPrimitiveCallParameterToken>();

            Token apiConvention = this.GetNextTokenxx(Preference.Default);
            if (!(apiConvention is KeywordToken))
                this.ReportParserError(result, SemanticErrors.MissingApiConvention, apiConvention);

            while(true)
            {
                Token tkn = this.GetNextTokenxx(Preference.Default);
                if (tkn is IPrimitiveCallParameterToken)
                {
                    parameters.Add((IPrimitiveCallParameterToken)tkn);
                }
                else if (Parser.IsApiClosingDelimiter(tkn))
                {

                    result.SetContents(token, tkn as BinarySelectorToken, apiConvention as KeywordToken, parameters);
                    return result;
                }
                else
                {
                    this.ReportParserError(result, SemanticErrors.UnexpectedApiParameterToken, tkn);
                    this.ResidueToken = tkn;

                    result.SetContents(token, tkn as BinarySelectorToken, apiConvention as KeywordToken, parameters);
                    return result;
                }
            }
        }