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 ///////////////////////////////////////////////////////////////////////////////
16 using namespace Common;
22 * OCS visitor to build the OCS. :) It's clear and simple, isn't it?
24 class OCSV_Builder : public OCS_Visitor {
27 FieldSpecs *fss; // ref.
29 OCSV_Builder(const OCSV_Builder& p);
30 void visit0(OCS_Node& p);
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);
41 * OCS visitor to parse an object definition.
43 class OCSV_Parser : public OCS_Visitor {
47 /** Stores whether the parsing was successful. If it is false, the
48 * parsing cannot be continued. */
50 /** Stores whether the previous parsing was successful. */
53 OCSV_Parser(const OCSV_Parser& p);
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);
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);
74 Object* parse_object();
75 ObjectSet* parse_objectset();
80 #endif // _Asn_OCSV_HH