parser.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. /* A Bison parser, made by GNU Bison 3.0.2. */
  2. /* Bison interface for Yacc-like parsers in C
  3. Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. /* As a special exception, you may create a larger work that contains
  15. part or all of the Bison parser skeleton and distribute that work
  16. under terms of your choice, so long as that work isn't itself a
  17. parser generator using the skeleton or a modified version thereof
  18. as a parser skeleton. Alternatively, if you modify or redistribute
  19. the parser skeleton itself, you may (at your option) remove this
  20. special exception, which will cause the skeleton and the resulting
  21. Bison output files to be licensed under the GNU General Public
  22. License without this special exception.
  23. This special exception was added by the Free Software Foundation in
  24. version 2.2 of Bison. */
  25. #ifndef YY_WDS_GEN_PARSER_H_INCLUDED
  26. # define YY_WDS_GEN_PARSER_H_INCLUDED
  27. /* Debug traces. */
  28. #ifndef YYDEBUG
  29. # define YYDEBUG 0
  30. #endif
  31. #if YYDEBUG
  32. extern int wds_debug;
  33. #endif
  34. /* "%code requires" blocks. */
  35. /*
  36. * This file is part of Wireless Display Software for Linux OS
  37. *
  38. * Copyright (C) 2015 Intel Corporation.
  39. *
  40. * This library is free software; you can redistribute it and/or
  41. * modify it under the terms of the GNU Lesser General Public
  42. * License as published by the Free Software Foundation; either
  43. * version 2.1 of the License, or (at your option) any later version.
  44. *
  45. * This library is distributed in the hope that it will be useful,
  46. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  47. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  48. * Lesser General Public License for more details.
  49. *
  50. * You should have received a copy of the GNU Lesser General Public
  51. * License along with this library; if not, write to the Free Software
  52. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  53. * 02110-1301 USA
  54. */
  55. #include <map>
  56. #include <memory>
  57. #include "libwds/rtsp/audiocodecs.h"
  58. #include "libwds/rtsp/contentprotection.h"
  59. #include "libwds/rtsp/triggermethod.h"
  60. #include "libwds/rtsp/route.h"
  61. #include "libwds/rtsp/uibcsetting.h"
  62. #include "libwds/rtsp/uibccapability.h"
  63. #define YYLEX_PARAM scanner
  64. namespace wds {
  65. struct AudioCodec;
  66. namespace rtsp {
  67. class Driver;
  68. class Scanner;
  69. class Message;
  70. class Header;
  71. class TransportHeader;
  72. class Property;
  73. class PropertyErrors;
  74. class Payload;
  75. class VideoFormats;
  76. struct H264Codec;
  77. struct H264Codec3d;
  78. }
  79. }
  80. /* Token type. */
  81. #ifndef YYTOKENTYPE
  82. # define YYTOKENTYPE
  83. enum yytokentype
  84. {
  85. END = 0,
  86. WFD_SP = 258,
  87. WFD_NUM = 259,
  88. WFD_OPTIONS = 260,
  89. WFD_SET_PARAMETER = 261,
  90. WFD_GET_PARAMETER = 262,
  91. WFD_SETUP = 263,
  92. WFD_PLAY = 264,
  93. WFD_TEARDOWN = 265,
  94. WFD_PAUSE = 266,
  95. WFD_END = 267,
  96. WFD_RESPONSE = 268,
  97. WFD_RESPONSE_CODE = 269,
  98. WFD_STRING = 270,
  99. WFD_GENERIC_PROPERTY = 271,
  100. WFD_HEADER = 272,
  101. WFD_CSEQ = 273,
  102. WFD_RESPONSE_METHODS = 274,
  103. WFD_TAG = 275,
  104. WFD_SUPPORT_CHECK = 276,
  105. WFD_REQUEST_URI = 277,
  106. WFD_CONTENT_TYPE = 278,
  107. WFD_MIME = 279,
  108. WFD_CONTENT_LENGTH = 280,
  109. WFD_AUDIO_CODECS = 281,
  110. WFD_VIDEO_FORMATS = 282,
  111. WFD_3D_FORMATS = 283,
  112. WFD_CONTENT_PROTECTION = 284,
  113. WFD_DISPLAY_EDID = 285,
  114. WFD_COUPLED_SINK = 286,
  115. WFD_TRIGGER_METHOD = 287,
  116. WFD_PRESENTATION_URL = 288,
  117. WFD_CLIENT_RTP_PORTS = 289,
  118. WFD_ROUTE = 290,
  119. WFD_I2C = 291,
  120. WFD_AV_FORMAT_CHANGE_TIMING = 292,
  121. WFD_PREFERRED_DISPLAY_MODE = 293,
  122. WFD_UIBC_CAPABILITY = 294,
  123. WFD_UIBC_SETTING = 295,
  124. WFD_STANDBY_RESUME_CAPABILITY = 296,
  125. WFD_STANDBY_IN_REQUEST = 297,
  126. WFD_STANDBY_IN_RESPONSE = 298,
  127. WFD_CONNECTOR_TYPE = 299,
  128. WFD_IDR_REQUEST = 300,
  129. WFD_AUDIO_CODECS_ERROR = 301,
  130. WFD_VIDEO_FORMATS_ERROR = 302,
  131. WFD_3D_FORMATS_ERROR = 303,
  132. WFD_CONTENT_PROTECTION_ERROR = 304,
  133. WFD_DISPLAY_EDID_ERROR = 305,
  134. WFD_COUPLED_SINK_ERROR = 306,
  135. WFD_TRIGGER_METHOD_ERROR = 307,
  136. WFD_PRESENTATION_URL_ERROR = 308,
  137. WFD_CLIENT_RTP_PORTS_ERROR = 309,
  138. WFD_ROUTE_ERROR = 310,
  139. WFD_I2C_ERROR = 311,
  140. WFD_AV_FORMAT_CHANGE_TIMING_ERROR = 312,
  141. WFD_PREFERRED_DISPLAY_MODE_ERROR = 313,
  142. WFD_UIBC_CAPABILITY_ERROR = 314,
  143. WFD_UIBC_SETTING_ERROR = 315,
  144. WFD_STANDBY_RESUME_CAPABILITY_ERROR = 316,
  145. WFD_STANDBY_ERROR = 317,
  146. WFD_CONNECTOR_TYPE_ERROR = 318,
  147. WFD_IDR_REQUEST_ERROR = 319,
  148. WFD_GENERIC_PROPERTY_ERROR = 320,
  149. WFD_NONE = 321,
  150. WFD_AUDIO_CODEC_LPCM = 322,
  151. WFD_AUDIO_CODEC_AAC = 323,
  152. WFD_AUDIO_CODEC_AC3 = 324,
  153. WFD_HDCP_SPEC_2_0 = 325,
  154. WFD_HDCP_SPEC_2_1 = 326,
  155. WFD_IP_PORT = 327,
  156. WFD_PRESENTATION_URL_0 = 328,
  157. WFD_PRESENTATION_URL_1 = 329,
  158. WFD_STREAM_PROFILE = 330,
  159. WFD_MODE_PLAY = 331,
  160. WFD_ROUTE_PRIMARY = 332,
  161. WFD_ROUTE_SECONDARY = 333,
  162. WFD_INPUT_CATEGORY_LIST = 334,
  163. WFD_INPUT_CATEGORY_GENERIC = 335,
  164. WFD_INPUT_CATEGORY_HIDC = 336,
  165. WFD_GENERIC_CAP_LIST = 337,
  166. WFD_INPUT_TYPE_KEYBOARD = 338,
  167. WFD_INPUT_TYPE_MOUSE = 339,
  168. WFD_INPUT_TYPE_SINGLE_TOUCH = 340,
  169. WFD_INPUT_TYPE_MULTI_TOUCH = 341,
  170. WFD_INPUT_TYPE_JOYSTICK = 342,
  171. WFD_INPUT_TYPE_CAMERA = 343,
  172. WFD_INPUT_TYPE_GESTURE = 344,
  173. WFD_INPUT_TYPE_REMOTE_CONTROL = 345,
  174. WFD_HIDC_CAP_LIST = 346,
  175. WFD_INPUT_PATH_INFRARED = 347,
  176. WFD_INPUT_PATH_USB = 348,
  177. WFD_INPUT_PATH_BT = 349,
  178. WFD_INPUT_PATH_WIFI = 350,
  179. WFD_INPUT_PATH_ZIGBEE = 351,
  180. WFD_INPUT_PATH_NOSP = 352,
  181. WFD_UIBC_SETTING_ENABLE = 353,
  182. WFD_UIBC_SETTING_DISABLE = 354,
  183. WFD_SUPPORTED = 355,
  184. WFD_SESSION = 356,
  185. WFD_SESSION_ID = 357,
  186. WFD_TIMEOUT = 358,
  187. WFD_TRANSPORT = 359,
  188. WFD_SERVER_PORT = 360
  189. };
  190. #endif
  191. /* Value type. */
  192. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  193. typedef union YYSTYPE YYSTYPE;
  194. union YYSTYPE
  195. {
  196. std::string* sval;
  197. unsigned long long int nval;
  198. bool bool_val;
  199. std::vector<std::string>* vsval;
  200. wds::rtsp::Message* message;
  201. wds::rtsp::Header* header;
  202. wds::rtsp::Payload* mpayload;
  203. wds::AudioFormats audio_format;
  204. wds::rtsp::Property* property;
  205. std::vector<unsigned short>* error_list;
  206. wds::rtsp::PropertyErrors* property_errors;
  207. std::map<wds::rtsp::PropertyType, std::shared_ptr<wds::rtsp::PropertyErrors>>* property_error_map;
  208. std::vector<wds::rtsp::H264Codec>* codecs;
  209. wds::rtsp::H264Codec* codec;
  210. std::vector<wds::rtsp::H264Codec3d>* codecs_3d;
  211. wds::rtsp::H264Codec3d* codec_3d;
  212. wds::rtsp::ContentProtection::HDCPSpec hdcp_spec;
  213. wds::rtsp::TriggerMethod::Method trigger_method;
  214. wds::rtsp::Route::Destination route_destination;
  215. bool uibc_setting;
  216. std::vector<wds::rtsp::UIBCCapability::InputCategory>* input_category_list;
  217. std::vector<wds::rtsp::UIBCCapability::InputType>* generic_cap_list;
  218. std::vector<wds::rtsp::UIBCCapability::DetailedCapability>* hidc_cap_list;
  219. wds::rtsp::UIBCCapability::InputCategory input_category_list_value;
  220. wds::rtsp::UIBCCapability::InputType generic_cap_list_value;
  221. wds::rtsp::UIBCCapability::DetailedCapability* hidc_cap_list_value;
  222. wds::rtsp::UIBCCapability::InputPath input_path;
  223. wds::rtsp::Method method;
  224. std::vector<wds::rtsp::Method>* methods;
  225. wds::rtsp::PropertyType parameter;
  226. std::vector<wds::rtsp::PropertyType>* parameters;
  227. std::vector<wds::AudioCodec>* audio_codecs;
  228. wds::AudioCodec* audio_codec;
  229. std::pair<std::string, unsigned int>* session_info;
  230. wds::rtsp::TransportHeader* transport;
  231. };
  232. # define YYSTYPE_IS_TRIVIAL 1
  233. # define YYSTYPE_IS_DECLARED 1
  234. #endif
  235. int wds_parse (void* scanner, std::unique_ptr<wds::rtsp::Message>& message);
  236. #endif /* !YY_WDS_GEN_PARSER_H_INCLUDED */