parse method

dynamic parse(
  1. dynamic input,
  2. dynamic startRule
)

Implementation

parse(input, startRule) {
  var parseFunctions = {
    "CRLF": _parse_CRLF,
    "DIGIT": _parse_DIGIT,
    "ALPHA": _parse_ALPHA,
    "HEXDIG": _parse_HEXDIG,
    "WSP": _parse_WSP,
    "OCTET": _parse_OCTET,
    "DQUOTE": _parse_DQUOTE,
    "SP": _parse_SP,
    "HTAB": _parse_HTAB,
    "alphanum": _parse_alphanum,
    "reserved": _parse_reserved,
    "unreserved": _parse_unreserved,
    "mark": _parse_mark,
    "escaped": _parse_escaped,
    "LWS": _parse_LWS,
    "SWS": _parse_SWS,
    "HCOLON": _parse_HCOLON,
    "TEXT_UTF8_TRIM": _parse_TEXT_UTF8_TRIM,
    "TEXT_UTF8char": _parse_TEXT_UTF8char,
    "UTF8_NONASCII": _parse_UTF8_NONASCII,
    "UTF8_CONT": _parse_UTF8_CONT,
    "LHEX": parse_LHEX,
    "token": _parse_token,
    "token_nodot": _parse_token_nodot,
    "separators": parse_separators,
    "word": _parse_word,
    "STAR": _parse_STAR,
    "SLASH": _parse_SLASH,
    "EQUAL": _parse_EQUAL,
    "LPAREN": _parse_LPAREN,
    "RPAREN": _parse_RPAREN,
    "RAQUOT": _parse_RAQUOT,
    "LAQUOT": _parse_LAQUOT,
    "COMMA": _parse_COMMA,
    "SEMI": _parse_SEMI,
    "COLON": _parse_COLON,
    "LDQUOT": _parse_LDQUOT,
    "RDQUOT": _parse_RDQUOT,
    "comment": parse_comment,
    "ctext": _parse_ctext,
    "quoted_string": _parse_quoted_string,
    "quoted_string_clean": _parse_quoted_string_clean,
    "qdtext": _parse_qdtext,
    "quoted_pair": _parse_quoted_pair,
    "SIP_URI_noparams": _parse_SIP_URI_noparams,
    "SIP_URI": _parse_SIP_URI,
    "uri_scheme": _parse_uri_scheme,
    "uri_scheme_sips": _parse_uri_scheme_sips,
    "uri_scheme_sip": _parse_uri_scheme_sip,
    "userinfo": _parse_userinfo,
    "user": _parse_user,
    "user_unreserved": _parse_user_unreserved,
    "password": _parse_password,
    "hostport": _parse_hostport,
    "host": _parse_host,
    "hostname": _parse_hostname,
    "domainlabel": _parse_domainlabel,
    "toplabel": _parse_toplabel,
    "IPv6reference": _parse_IPv6reference,
    "IPv6address": _parse_IPv6address,
    "h16": _parse_h16,
    "ls32": _parse_ls32,
    "IPv4address": _parse_IPv4address,
    "dec_octet": _parse_dec_octet,
    "port": _parse_port,
    "uri_parameters": _parse_uri_parameters,
    "uri_parameter": _parse_uri_parameter,
    "transport_param": _parse_transport_param,
    "user_param": _parse_user_param,
    "method_param": _parse_method_param,
    "ttl_param": _parse_ttl_param,
    "maddr_param": _parse_maddr_param,
    "lr_param": _parse_lr_param,
    "other_param": _parse_other_param,
    "pname": _parse_pname,
    "pvalue": _parse_pvalue,
    "paramchar": _parse_paramchar,
    "param_unreserved": _parse_param_unreserved,
    "headers": _parse_headers,
    "header": _parse_header,
    "hname": _parse_hname,
    "hvalue": _parse_hvalue,
    "hnv_unreserved": _parse_hnv_unreserved,
    "Request_Response": parse_Request_Response,
    "Request_Line": _parse_Request_Line,
    "Request_URI": _parse_Request_URI,
    "absoluteURI": _parse_absoluteURI,
    "hier_part": _parse_hier_part,
    "net_path": _parse_net_path,
    "abs_path": _parse_abs_path,
    "opaque_part": _parse_opaque_part,
    "uric": _parse_uric,
    "uric_no_slash": _parse_uric_no_slash,
    "path_segments": _parse_path_segments,
    "segment": _parse_segment,
    "param": _parse_param,
    "pchar": _parse_pchar,
    "scheme": _parse_scheme,
    "authority": _parse_authority,
    "srvr": _parse_srvr,
    "reg_name": _parse_reg_name,
    "query": _parse_query,
    "SIP_Version": _parse_SIP_Version,
    "INVITEm": _parse_INVITEm,
    "ACKm": _parse_ACKm,
    "OPTIONSm": _parse_OPTIONSm,
    "BYEm": _parse_BYEm,
    "CANCELm": _parse_CANCELm,
    "REGISTERm": _parse_REGISTERm,
    "SUBSCRIBEm": _parse_SUBSCRIBEm,
    "NOTIFYm": _parse_NOTIFYm,
    "REFERm": _parse_REFERm,
    "Method": _parse_Method,
    "Status_Line": _parse_Status_Line,
    "Status_Code": _parse_Status_Code,
    "extension_code": _parse_extension_code,
    "Reason_Phrase": _parse_Reason_Phrase,
    "Allow_Events": parse_Allow_Events,
    "Call_ID": parse_Call_ID,
    "Contact": parse_Contact,
    "contact_param": _parse_contact_param,
    "name_addr": _parse_name_addr,
    "display_name": _parse_display_name,
    "contact_params": _parse_contact_params,
    "c_p_q": _parse_c_p_q,
    "c_p_expires": _parse_c_p_expires,
    "delta_seconds": _parse_delta_seconds,
    "qvalue": _parse_qvalue,
    "generic_param": _parse_generic_param,
    "gen_value": _parse_gen_value,
    "Content_Disposition": parse_Content_Disposition,
    "disp_type": _parse_disp_type,
    "disp_param": _parse_disp_param,
    "handling_param": _parse_handling_param,
    "Content_Encoding": parse_Content_Encoding,
    "Content_Length": parse_Content_Length,
    "Content_Type": parse_Content_Type,
    "media_type": _parse_media_type,
    "m_type": _parse_m_type,
    "discrete_type": _parse_discrete_type,
    "composite_type": _parse_composite_type,
    "extension_token": _parse_extension_token,
    "x_token": _parse_x_token,
    "m_subtype": _parse_m_subtype,
    "m_parameter": _parse_m_parameter,
    "m_value": _parse_m_value,
    "CSeq": parse_CSeq,
    "CSeq_value": _parse_CSeq_value,
    "Expires": parse_Expires,
    "Event": parse_Event,
    "event_type": _parse_event_type,
    "From": parse_From,
    "from_param": _parse_from_param,
    "tag_param": _parse_tag_param,
    "Max_Forwards": parse_Max_Forwards,
    "Min_Expires": parse_Min_Expires,
    "Name_Addr_Header": parse_Name_Addr_Header,
    "Proxy_Authenticate": parse_Proxy_Authenticate,
    "challenge": _parse_challenge,
    "other_challenge": _parse_other_challenge,
    "auth_param": _parse_auth_param,
    "digest_cln": _parse_digest_cln,
    "realm": _parse_realm,
    "realm_value": _parse_realm_value,
    "domain": _parse_domain,
    "URI": _parse_URI,
    "nonce": _parse_nonce,
    "nonce_value": _parse_nonce_value,
    "opaque": _parse_opaque,
    "stale": _parse_stale,
    "algorithm": _parse_algorithm,
    "qop_options": _parse_qop_options,
    "qop_value": _parse_qop_value,
    "Proxy_Require": parse_Proxy_Require,
    "Record_Route": parse_Record_Route,
    "rec_route": _parse_rec_route,
    "Reason": parse_Reason,
    "reason_param": _parse_reason_param,
    "reason_cause": _parse_reason_cause,
    "Require": parse_Require,
    "Route": parse_Route,
    "route_param": _parse_route_param,
    "Subscription_State": parse_Subscription_State,
    "substate_value": _parse_substate_value,
    "subexp_params": _parse_subexp_params,
    "event_reason_value": _parse_event_reason_value,
    "Subject": parse_Subject,
    "Supported": parse_Supported,
    "To": parse_To,
    "to_param": _parse_to_param,
    "Via": parse_Via,
    "via_param": _parse_via_param,
    "via_params": _parse_via_params,
    "via_ttl": _parse_via_ttl,
    "via_maddr": _parse_via_maddr,
    "via_received": _parse_via_received,
    "via_branch": _parse_via_branch,
    "response_port": _parse_response_port,
    "sent_protocol": _parse_sent_protocol,
    "protocol_name": _parse_protocol_name,
    "transport": _parse_transport,
    "sent_by": _parse_sent_by,
    "via_host": _parse_via_host,
    "via_port": _parse_via_port,
    "ttl": _parse_ttl,
    "WWW_Authenticate": parse_WWW_Authenticate,
    "Session_Expires": parse_Session_Expires,
    "s_e_expires": _parse_s_e_expires,
    "s_e_params": _parse_s_e_params,
    "s_e_refresher": _parse_s_e_refresher,
    "extension_header": parse_extension_header,
    "header_value": _parse_header_value,
    "message_body": parse_message_body,
    "uuid_URI": parse_uuid_URI,
    "uuid": _parse_uuid,
    "hex4": _parse_hex4,
    "hex8": _parse_hex8,
    "hex12": _parse_hex12,
    "Refer_To": parse_Refer_To,
    "Replaces": parse_Replaces,
    "call_id": _parse_call_id,
    "replaces_param": _parse_replaces_param,
    "to_tag": _parse_to_tag,
    "from_tag": _parse_from_tag,
    "early_flag": _parse_early_flag
  };
  if (input == null) {
    throw ArgumentError('text: $input');
  }
  _input = _toCodePoints(input);
  _inputLen = _input.length;
  reset(0);

  if (startRule != null) {
    if (parseFunctions[startRule] == null) {
      throw ArgumentError("Invalid rule name: " + startRule + ".");
    }
  } else {
    startRule = "CRLF";
  }
  this.startRule = startRule;
  return parseFunctions[startRule]!();
}