Sync with 5.1.0
[deliverable/titan.core.git] / compiler2 / asn1 / OCSV.hh
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #ifndef _Asn_OCSV_HH
9 #define _Asn_OCSV_HH
10
11 #include "Object.hh"
12 #include "Block.hh"
13
14 namespace Asn {
15
16 using namespace Common;
17
18 class OCSV_Builder;
19 class OCSV_Parser;
20
21 /**
22 * OCS visitor to build the OCS. :) It's clear and simple, isn't it?
23 */
24 class OCSV_Builder : public OCS_Visitor {
25 private:
26 TokenBuf *tb;
27 FieldSpecs *fss; // ref.
28
29 OCSV_Builder(const OCSV_Builder& p);
30 void visit0(OCS_Node& p);
31 public:
32 OCSV_Builder(TokenBuf *p_tb, FieldSpecs *p_fss);
33 virtual ~OCSV_Builder();
34 virtual void visit_root(OCS_root& p);
35 virtual void visit_seq(OCS_seq& p);
36 virtual void visit_literal(OCS_literal& p);
37 virtual void visit_setting(OCS_setting& p);
38 };
39
40 /**
41 * OCS visitor to parse an object definition.
42 */
43 class OCSV_Parser : public OCS_Visitor {
44 private:
45 TokenBuf *tb;
46 Obj_defn *my_obj;
47 /** Stores whether the parsing was successful. If it is false, the
48 * parsing cannot be continued. */
49 bool success;
50 /** Stores whether the previous parsing was successful. */
51 bool prev_success;
52
53 OCSV_Parser(const OCSV_Parser& p);
54 public:
55 OCSV_Parser(TokenBuf *p_tb, Obj_defn *p_my_obj);
56 virtual ~OCSV_Parser();
57 virtual void visit_root(OCS_root& p);
58 virtual void visit_seq(OCS_seq& p);
59 virtual void visit_literal(OCS_literal& p);
60 virtual void visit_setting(OCS_setting& p);
61 private:
62 size_t is_ref(size_t pos);
63 size_t is_tag(size_t pos);
64 size_t is_constraint(size_t pos);
65 size_t is_constraints(size_t pos);
66 size_t is_nakedtype(size_t pos);
67 size_t is_type(size_t pos);
68 size_t is_value(size_t pos);
69 size_t is_object(size_t pos);
70 size_t is_objectset(size_t pos);
71 Block* get_first_n(size_t n);
72 Type* parse_type();
73 Value* parse_value();
74 Object* parse_object();
75 ObjectSet* parse_objectset();
76 };
77
78 } // namespace Asn
79
80 #endif // _Asn_OCSV_HH
This page took 0.031444 seconds and 5 git commands to generate.