List Info

Thread: KDevelop-PG bug when printing First/Follow conflicts




KDevelop-PG bug when printing First/Follow conflicts
user name
2007-07-19 17:32:40
Hi,

I think there's a bug when kdevelop prints the warning
about
first/follow conflicts. The output for the qmake parser
before revision
690040 contained 

** WARNING found FIRST/FOLLOW conflict in quoted_value:
        Rule ``(value=quote_value)*''
        Terminals [
        COMMA: conflicts with the FIRST set of: ,
        DOUBLEDOLLAR: conflicts with the FIRST set of: ,
        SINGLEDOLLAR: conflicts with the FIRST set of: ,
        IDENTIFIER: conflicts with the FIRST set of: ,
        VALUE: conflicts with the FIRST set of:
        ]

and the information about which rules/tokens first set
conflicted with
the follow set of the rule is missing. I looked at the code,
but didn't
get very far. 

Andreas

-- 
People are beginning to notice you.  Try dressing before you
leave the house.

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: KDevelop-PG bug when printing First/Follow conflicts
country flaguser name
Italy
2007-07-19 18:13:12

Hi Andreas!

Il giorno 20/lug/07, alle ore 00:32, Andreas Pakulat ha scritto:

Hi,

I think there's a bug when kdevelop prints the warning about
first/follow conflicts. The output for the qmake parser before revision
690040 contained 

actually I found a good number of bugs in kdev-pg :( For instance, --no-ast is broken, scopes are not working as expected,  yy_expected_token is used in the wrong way and a few other little things. So, it's time for a new version My plan:

 - update astyle. The version used in kdev-pg is very old and buggy. 

 - improve the library. I want generalize the kdev-pg-token-stream and rewrite AST and Visitors

 - do something with the AST generator. Maybe I just have to write a different tool to generate ASTs

 - automatic backtracking

 - deprecate the current input file format and use something a little bit "more standard" (a lot of people asked for it). It sucks because I have to write a tool to convert kdev-pg 1.x files :(



and the information about which rules/tokens first set conflicted with
the follow set of the rule is missing. I looked at the code, but didn't
get very far. 

and of course fix this one

I will branch kdev-pg and start to fix it tomorrow. I will send an email to kdevelop-devel with the url of the new repository.

ciao robe

Re: KDevelop-PG bug when printing First/Follow conflicts
user name
2007-07-19 18:25:22
On 7/19/07, Roberto Raggi <robertokdevelop.org> wrote:
> and the information about which rules/tokens first set
conflicted with
> the follow set of the rule is missing. I looked at the
code, but didn't
> get very far.
> and of course fix this one 

Well, I have the fix on my disk here already. Now I just
need to fix
my fix so it doesn't introduce infinite loops 

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: KDevelop-PG bug when printing First/Follow conflicts
country flaguser name
Italy
2007-07-19 18:44:57
Il giorno 20/lug/07, alle ore 01:13, Roberto Raggi ha
scritto:
>
>  - improve the library. I want generalize the
kdev-pg-token-stream  
> and rewrite AST and Visitors

for instance the code to visit a list_node<ast*> is
very ugly   
look at this

     if (node->stmt_sequence)
       {
         const list_node<statement_ast*> *__it =
node->stmt_sequence- 
 >to_front(), *__end = __it;
         do
           {
             visit_node(__it->element);
             __it = __it->next;
           }
         while (__it != __end);
       }

see? it doesn't have to be so ugly and difficult to use.

I think I will change the coding style of the generated code
too,  
something a little more Qt friendly. I was in I want to be a
STL- 
developer-mode when I started kdev-pg, but now I'm sick of
all that  
underscores 

ciao robe


_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: KDevelop-PG bug when printing First/Follow conflicts
user name
2007-07-19 19:06:02
On 7/19/07, Roberto Raggi <robertokdevelop.org> wrote:
> I think I will change the coding style of the generated
code too,
> something a little more Qt friendly. I was in I want to
be a STL-
> developer-mode when I started kdev-pg, but now I'm sick
of all that
> underscores 
Cool, cool, cool 

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: KDevelop-PG bug when printing First/Follow conflicts
user name
2007-07-20 05:43:05
On 20.07.07 01:44:57, Roberto Raggi wrote:
> I think I will change the coding style of the generated
code too,  
> something a little more Qt friendly. I was in I want to
be a STL- 
> developer-mode when I started kdev-pg, but now I'm sick
of all that  
> underscores 

ROFLMAO  I actually
tried to at least change the generated file names,
but the hack was too hackish to commit 

Andreas

-- 
You have an unusual understanding of the problems of human
relationships.

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: KDevelop-PG bug when printing First/Follow conflicts
user name
2007-07-20 07:15:11
On 20.07.07 01:13:12, Roberto Raggi wrote:
> Il giorno 20/lug/07, alle ore 00:32, Andreas Pakulat ha
scritto:
>  - deprecate the current input file format and use
something a little bit "more 
> standard" (a lot of people asked for it). It sucks
because I have to write a 
> tool to convert kdev-pg 1.x files :(

Personally I don't mind the current input format, except
maybe that the
rule name comes after the rule content, which somehow is
opposite to my
usual workflow...

Andreas

-- 
You worry too much about your job.  Stop it.  You are not
paid enough to worry.

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: KDevelop-PG bug when printing First/Follow conflicts
user name
2007-07-20 18:11:23
Ok, here's the patch. The only problem is that it breaks for
ruby.g so
please don't commit it.


Index: kdev-pg/kdev-pg-follow.cpp
============================================================
=======
--- kdev-pg/kdev-pg-follow.cpp  (revision 690051)
+++ kdev-pg/kdev-pg-follow.cpp  (working copy)
 -228,6
+228,13 

 void next_FOLLOW::add_follow_to_follow_dep(model::node
*dest, model::node *dep)
 {
+  if (dest->kind == model::node_kind_nonterminal)
+  {
+    model::symbol_item *s =
node_cast<model::nonterminal_item*>(dest)->_M_symbo
l;
+    if (s)
+      _G_system.FOLLOW_DEP(s).second.insert(dep);
+  }
+  else
   _G_system.FOLLOW_DEP(dest).second.insert(dep);
 #ifdef FOLLOW_DEP_DEBUG
   debug_follow_to_follow_dep(dest, dep);

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: KDevelop-PG bug when printing First/Follow conflicts
user name
2007-07-20 18:28:04
On 20.07.07 16:11:23, Alexander Dymo wrote:
> Ok, here's the patch. The only problem is that it
breaks for ruby.g so
> please don't commit it.

It also breaks for the java,csharp and python grammar. It
just doesn't
break on the qmake parser in KDevelop4. To test replace the
(QUOTE |
CONT NEWLINE) in the quoted_value rule (line 132) with
(QUOTE | 0). This
will create a first/follow conflict (actually the only one I
ever saw in
the qmake grammar).

Andreas

-- 
While you recently had your problems on the run, they've
regrouped and
are making another attack.

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: KDevelop-PG bug when printing First/Follow conflicts
user name
2007-07-20 23:52:18
Correct fix is in trunk now.

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

[1-10]

about | contact  Other archives ( Real Estate discussion Medical topics )