private ExpressionFunctionCall VisitFunctionCall(GLSL_ES300Parser.Function_call_genericContext context) { var result = new ExpressionFunctionCall(); GLSL_ES300Parser.Function_call_headerContext header = null; var headerNoParams = context.function_call_header_no_parameters(); if (headerNoParams != null) { header = headerNoParams.function_call_header(); } var headerWithParams = context.function_call_header_with_parameters(); if (headerWithParams != null) { while (headerWithParams != null) { result.Parameters.Add((Expression)this.Visit(headerWithParams.assignment_expression())); header = headerWithParams.function_call_header(); headerWithParams = headerWithParams.function_call_header_with_parameters(); } result.Parameters.Reverse(); } var identifier = header.function_identifier(); var id = identifier.Identifier(); if (id != null) { result.Identifier = new Identifier() { Name = id.Symbol.Text }; } var field = identifier.field_selection(); if (field != null) { result.Identifier = new Identifier() { Name = field.Identifier().Symbol.Text }; } var type = identifier.type_specifier(); if (type != null) { if (type.precision_qualifier() != null) { throw new NotSupportedException("Precision qualifier is not supported for type as function identifier."); } var typeSpec = type.type_specifier_noprec(); if (typeSpec.LeftBracket() != null) { throw new NotSupportedException("Array specifier is not supported for type as function identifier."); } var typeSpecNonArr = typeSpec.type_specifier_nonarray(); if (typeSpecNonArr.struct_specifier() != null) { throw new NotSupportedException("Struct specifier is not supported for type as function identifier."); } result.Identifier = new Identifier() { Name = typeSpec.GetText() }; } return(result); }
/// <summary> /// Visit a parse tree produced by <see cref="GLSL_ES300Parser.function_call_generic"/>. /// <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 VisitFunction_call_generic([NotNull] GLSL_ES300Parser.Function_call_genericContext context) { return(VisitChildren(context)); }