Gentoo Archives: gentoo-commits

From: Steve Arnold <nerdboy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/cccc/files/
Date: Mon, 06 Mar 2017 07:17:15
Message-Id: 1488784619.0903db364fb0a9e3ce66947a374b5511e19525ac.nerdboy@gentoo
1 commit: 0903db364fb0a9e3ce66947a374b5511e19525ac
2 Author: Stephen L Arnold <nerdboy <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 6 07:15:51 2017 +0000
4 Commit: Steve Arnold <nerdboy <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 6 07:16:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0903db36
7
8 dev-util/cccc: Add missing MFC dialect patch and options file
9
10 Closes bug 602368.
11
12 Package-Manager: Portage-2.3.3, Repoman-2.3.1
13
14 dev-util/cccc/files/cccc-MFC-dialect.opt | 21 +++++++++
15 dev-util/cccc/files/cccc-c_dialect.patch | 79 ++++++++++++++++++++++++++++++++
16 2 files changed, 100 insertions(+)
17
18 diff --git a/dev-util/cccc/files/cccc-MFC-dialect.opt b/dev-util/cccc/files/cccc-MFC-dialect.opt
19 new file mode 100644
20 index 00000000000..4c4acb32e1f
21 --- /dev/null
22 +++ b/dev-util/cccc/files/cccc-MFC-dialect.opt
23 @@ -0,0 +1,21 @@
24 +;;Pro*C embedded SQL
25 +;; looks like
26 +;; EXEC SQL UPDATE ARM43_OD_PRODUIT_SERV
27 +;; SET ARM43ID_TPS_FIN = NULL WHERE
28 +ARM43ID_TPS_FIN = 0;
29 +
30 +CCCC_FileExt@.pc@c++.ansi@
31 +
32 +CCCC_Dialect@c++.pc@EXEC@skip_stmt@
33 +
34 +;;MFC
35 +CCCC_Dialect@c++.mfc@ON_WM_PAINT@skip_line@
36 +CCCC_Dialect@c++.mfc@DECLARE_MESSAGE_MAP@skip_line@
37 +CCCC_Dialect@c++.mfc@DECLARE_DISPATCH_MAP@skip_line@
38 +
39 +CCCC_Dialect@c++.stl@__STL_BEGIN_NAMESPACE@ignore@
40 +CCCC_Dialect@c++.stl@__STL_END_NAMESPACE@ignore@
41 +
42 +CCCC_Dialect@c++.mfc@BEGIN_EVENT_MAP@start_skipping@
43 +CCCC_Dialect@c++.mfc@END_EVENT_MAP@stop_skipping@
44 +
45
46 diff --git a/dev-util/cccc/files/cccc-c_dialect.patch b/dev-util/cccc/files/cccc-c_dialect.patch
47 new file mode 100644
48 index 00000000000..c8951aef13c
49 --- /dev/null
50 +++ b/dev-util/cccc/files/cccc-c_dialect.patch
51 @@ -0,0 +1,79 @@
52 +diff --git a/cccc/cccc.g b/cccc/cccc.g
53 +index bdb6805..fd7b504 100644
54 +--- a/cccc/cccc.g
55 ++++ b/cccc/cccc.g
56 +@@ -84,6 +84,30 @@ inline void endOfLine(CLexer &lexer)
57 + #token MAC_NL "\r" << endOfLine(*this); >>
58 + #token UNIX_NL "\n" << endOfLine(*this); >>
59 +
60 ++/* augment dialect policies -- M.H added */
61 ++#lexclass SKIP_STMT
62 ++#token SKCOLON ";" << skip();mode(START); >>
63 ++#token SKANYTHING "~[; \t\n]" << skip();more();>>
64 ++#token SKNL "\n" << skip();endOfLine(*this);>>
65 ++#token SKBLANK "[ \t]+" << skip(); >>
66 ++#lexclass START
67 ++
68 ++#lexclass SKIP_BLOCK
69 ++#token SK_ANY "[a-zA-Z0-9_]*"
70 ++<<
71 ++std::string treatment =
72 ++ CCCC_Options::dialectKeywordPolicy(parse_language,lextext());
73 ++
74 ++if ( treatment != "stop_skipping" )
75 ++{
76 ++ skip();
77 ++}
78 ++else
79 ++{
80 ++ mode(COMMENT_LINE);skip();
81 ++}
82 ++>>
83 ++#lexclass START
84 +
85 + /* preprocessor constructs - comments, #defines etc */
86 +
87 +@@ -343,17 +367,29 @@ inline void endOfLine(CLexer &lexer)
88 + if( treatment == "ignore" )
89 + {
90 + skip();
91 ++ //std::cout << toktext << std::endl <<" :ignore" << std::endl;
92 + }
93 + // Ultimately, the next two cases will need to be handled
94 + // using a #lexclass or something similar, for the moment
95 + // we just try to skip the tokens themselves.
96 + else if ( treatment == "start_skipping" )
97 + {
98 +- skip();
99 ++ mode(SKIP_BLOCK);skip();
100 + }
101 + else if ( treatment == "stop_skipping" )
102 + {
103 +- skip();
104 ++ skip(); mode(COMMENT_LINE);
105 ++ //gobble end of line M.H.
106 ++ }
107 ++ else if ( treatment == "skip_line" )//M.H added
108 ++ {
109 ++ mode(COMMENT_LINE);skip();
110 ++ //std::cout << "skip_line" << std::endl;
111 ++ }
112 ++ else if ( treatment == "skip_stmt" )//M.H added
113 ++ {
114 ++ mode(SKIP_STMT);skip();
115 ++ //std::cout << "skip_stmt" << std::endl;
116 + }
117 + >>
118 +
119 +@@ -426,8 +462,10 @@ void init(const string& filename, const string& language)
120 + pu=ParseUtility::currentInstance();
121 + ps=ParseStore::currentInstance();
122 +
123 +- ANTLRParser::init();
124 + parse_language=language;
125 ++ ANTLRParser::init();
126 ++ //parse_language=language;
127 ++ //move above, M.H.1st otherwise time init not to language
128 + }
129 +
130 + >>