Martin Stein | 2 Mar 23:22 2015
Picon
Picon

namespaces and prefix types in context analysis

Hi,

trying to figure out how C++ accomplishes computation of prefixe types 
for context analysis, I checked the following piece of code. It is 
derived from an equivalent f90 code, for which context analysis failed 
as well. Here it is:

namespace mystructs
{
   struct aaa
   {
     int xx;
   };

   struct bbb
   {
     struct aaa yy;
   };
}

struct bbb zz;

int fun()
{
   using mystructs;
   int uu = zz.!-1-
   int vv = zz.yy.!-2-
}

Completion at -1- works fine. Completion at -2- fails, because it cannot 
(Continue reading)

Tu Do | 2 Mar 10:10 2015
Picon

Disable tag grouping for sr-speedbar

Hi Eric,

I want to disable the grouping of tags in Speedbar, i.e. it groups functions in groups like "word_a" to "word_b". How do I do that?

Thanks.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-devel
Martin Stein | 19 Feb 22:24 2015
Picon
Picon

%use-macros

Hi,

In order to simplify integration of the preprocessor (wisent works 
differently than bovine, so I could not simply copy from the only 
example given in C/C++) I wanted to define my own grammar macros with 
%use-macros, which almost works, except for a few problems I could not 
resolve. I have created a semantic/wisent/f90-grammar-macros.el file, 
which contains

(defun semantic-f90-expand0-auxiliary (...)
   "Auxiliary function."
...)

(defun semantic-f90-grammar-macros-EXPAND0 (...)
   "Fortran 90 EXPAND macro with depth=0 and spp support."
...)

(provide 'semantic/wisent/f90-grammar-macros)

According to documentation which confirms with the code I would need to 
put the following into my f90.wy grammar file:

%use-macros semantic-f90-grammar-macros {EXPAND0}

However, the function inserting the macro into actions contains (see 
semantic/grammar.el, line 434ff in function semantic-grammar-use-macros)

(require lib)

where lib = semantic-f90-grammar-macros, which of course is nonsense. 
Naming the file semantic-f90-grammar-macros.el does neither fit the 
usual naming scheme nor does it help anyway. Using 
f90-grammar-macros-EXPAND0 does not help as well, since require still 
needs the path. Is there any other solution I have missed? As use-macros 
is not used anywhere, there is no example I could copy from.

There is another quandary, which leads to a simple albeit strange 
workaround: Replacing (require lib) by (require 
'semantic/wisent/f90-grammar-macros) works fine, until the compiler 
looks in vain for semantic-f90-expand0-auxiliary which is called from 
within semantic-f90-grammar-macros-EXPAND0. Adding a
%{
    (require 'semantic/wisent/f90-grammar-macros)
    ...
}
into my f90.wy file solves this problem. Even more, I can now delete the 
(require 'semantic/wisent/f90-grammar-macros) inside of 
semantic-grammar-use-macros and it still compiles. Almost. In fact, 
f90-grammar-macros is compiled after f90.wy, so whenever I edit 
f90-grammar-macros, I need to touch f90.wy and compile twice, or 
something like this. So I also need to add a dependency, but I could not 
figure out how to do this in Project.ede?
Or am I doing something fundamtally wrong??

Martin

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
Tu Do | 19 Feb 11:01 2015
Picon

Semantic cannot recognize tag name of operator "*"

For example, if I have overload operator "*", Semantic won't recognize it as a function, while for other operators it works fine.

For example:

Fixed & operator *(Fixed const & rhs);

Running (semantic-tag-name (semantic-current-tag)) returns an empty string.

Regards,

Tu.
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-devel
Martin Stein | 16 Feb 21:47 2015
Picon
Picon

Re: Two minor bugfixes

Hi Eric,

>> Second bug:
>> File: 0001-Save-global-variable-wisent-lookahead-before-calling.patch
>>
>> The wisent parser uses some global variables, which is a bit of a hassle
>> considering that it calls itself (via EXPANDFULL and the like). If the
>> last token of a recursive call does not match, it can corrupt the
>> unmatched-syntax-cache or even lead to wrong parse results. If recursive
>> calls of the parser are only done with parenthesised blocks and rules
>> are accordingly, then the last token must be something like ')' and thus
>> always matches and the bug is not triggered. For languages like fortran
>> this is different.
>> I am very sure that the commit indeed fixes a bug and nothing more, but
>> the wisent parser and its token stream organisation is a rather complex
>> automaton, so I might have missed something.
> This is a great find.  Thanks.  I've installed it here and it passes the
> test suites.  Was there an example that exposed this that is short you
> can share?  Can the bug be exposed using some existing language?  It
> would be nice if I could add a test for this.
With my fortran grammar the followng short exampe produces the error:

subroutine test(arg)
    call something()
end subroutine test

The token sequence produced by the lexer looks like
((SUBROUTINE 1 . 11)
  (NAME 12 . 16)
  (PAREN_BLOCK 16 . 21)
  (NEWLINE 21 . 22)
  (PROG_FUNC_SUBR_BODY 22 . 42)
  (END 42 . 45)
  (SUBROUTINE 46 . 56)
  (NAME 57 . 61)
  (NEWLINE 61 . 62))

PROG_FUNC_SUBR_BODY is something like the semantic-list in bovine. It
always needs to be expanded (via an expandfull-like macro with depth 0), 
as types of arguments to subroutine (not present here) are declared
inside this block (unlike C, where the type is inside of the PAREN_BLOCK 
token). As "call something()" is not a variable declaration, it fails to 
match anything. The last token is a NEWLINE at 41.42, which then gets 
wrongly reinjected, fails once more at the top level goal and ends up on 
the unmatched syntax cache.
If I add a rule for NEWLINE in the top-level goal
func-subr-mod-prog
   : one-function
   | one-subroutine
   | one-module
   | one-program
   | NEWLINE
     (TAG "error" 'error :region $region1)
   ;
I indeed get the error tag ("error" error (:region (41 . 42)) ...),
which clearly is a parse error, as there is no such newline at this level.

You might add this example once the fortran wisent grammar is included
in cedet. For some reason I cannot produce this with python or some
other language, even with some manipulations in the grammar. However,
the error recovery in wisent and some other issues makes it hard to
predict anything. In fact, I gave up to have a correct 
unmatch-syntax-cache with wisent, as there are some other issues, though 
I would like to come back to that (I like the unmatched syntax
highlighting I saw with some C/Qt Editors, thats helpful, but requires a 
more complete grammar anyway).

BTW: Is there any reason not to declare a wisent-parser class, with
slots for all those variables. All those indirections via global
variables (like with wisent-lexer-function) looks crazy. Clearly one
reason would be that its much work for not much gain.

Martin

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
Tu Do | 16 Feb 00:00 2015
Picon

Fwd: I released the refactoring tool


---------- Forwarded message ----------
From: Tu Do <tuhdo1710 <at> gmail.com>
Date: Mon, Feb 16, 2015 at 5:54 AM
Subject: Re: [CEDET-devel] I released the refactoring tool
To: David Engster <deng <at> randomsample.de>


That's my plan as well, using libtooling.

That's great if you can take care of this. I would not want to wait forever until we are permitted to use GCC :)

Not sure what you're planning here. Do you want to replace Semanticdb
completely, or do you want to make Sqlite a back end for Semanticdb?
Hard to say how much that would gain, since AFAIK, there's no efficient
way to transfer large amounts of data between Emacs and Sqlite.

I want to make Sqlite a backend for SemanticDB, not replacing it with my own, since it is possible to use another backend (if I understood correctly from Semantic documentation). It's hard to say whether it works well enough until we try. But I think at the current state, Emacs is pretty good at retrieving and processing data from external process. For example, I use helm-ag that uses Ag with Helm interface to search for a large amount of text, and the results are updated for every character I entered into the prompt. It looks like this: http://tuhdo.github.io/static/live_grep.gif

Another example is helm-gtags: https://github.com/syohex/emacs-helm-gtags that uses GNU Global tag database and Helm frontend. It searches very fast and gives results instantly, even if there are more than 10,000 matches and won't block Emacs.  I am using it to surf through large code base with ease. 

The benefits are:

- Async: this alone is worth it.
- Code querying with a popular and robust language. This will enable people to write small utilities using SQL, such as code metrics or statistics. With an actual database engine, we can do operation like searching for all functions that call current function, accurately; or all files that include a particular header files; or see all the included files that contain the definitions of tags in a current class; or simply creating a class index of a project (similar to what Ebrowse does, but for large index, it took Emacs really long to load all).... All of this can be delegated to a fast database engine. All we need is a properly designed database for tags.

On Mon, Feb 16, 2015 at 5:24 AM, David Engster <deng <at> randomsample.de> wrote:
Tu Do writes:
> As discussed before, in the long run, I want to write an source code indexer
> with Clang that is compatible with Semantic, so the built-in parser only needs
> to be responsible for new code entered from the keyboard, not existing code
> which could be huge.

That's my plan as well, using libtooling.

> Also, I intend to use Sqlite to store create a real tag database. The
> advantages:
>
> - We can do async operation because Sqlite is an external process, so Emacs
> does not have to do the heavy lifting of various tag querying operations and
> does not have to keep tags in memory. The database can take care of it.

Not sure what you're planning here. Do you want to replace Semanticdb
completely, or do you want to make Sqlite a back end for Semanticdb?
Hard to say how much that would gain, since AFAIK, there's no efficient
way to transfer large amounts of data between Emacs and Sqlite.

-David


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-devel
David Engster | 15 Feb 22:52 2015
Picon

EIEIO development moved to Emacs

Today I have moved EIEIO to the obsolete directory. If you want to work
on EIEIO, please do so directly in Emacs proper.

Unfortunately, we cannot simply use the EIEIO that ships with Emacs for
all 24.x versions, so I had at least to put eieio.el and
eieio-core/base.el into our fallback libraries. This was needed because
the persistent class loader learned new features in Emacs 24.3 which are
used by CEDET.

This made all 24.x builds green again in the Buildbot. Yay! There are
still quite a lot of warnings; if someone would like to tackle these,
it'd be much appreciated.

However, Emacs 25 is still completely broken, since Stefan has changed a
lot of things in EIEIO. So as a next step, I will convert CEDET to use
the new cl-generic (meaning: use cl-defmethod and friends), and also
deal with the cases where eieio-object-name-string was used for "real"
work. Since those object names are obsoleted, all this breaks in Emacs
25.

Then we'll have to decide how to resume merging with Emacs after the Git
switch. For this, I also plan to remove old compatibility cruft which
makes merging harder, like the stuff for XEmacs. I see no point in
keeping this, as CEDET didn't run on XEmacs for many years.

And then, maybe, I can get back to actually hack on things that are
fun...

-David

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
Tu Do | 12 Feb 08:07 2015
Picon

I released the refactoring tool

Hi Eric and list,

Today I released Semantic Refactor, a refactoring tool based on Semantic parser framework:  https://github.com/tuhdo/semantic-refactor

Here are the demos: https://github.com/tuhdo/semantic-refactor/blob/master/srefactor-demos/demos.md

I said I would release it last week but it's more than I thought. But here it is at last.

I hope it is useful.

Regards,

Tu.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-devel
Martin Stein | 11 Feb 23:47 2015
Picon
Picon

Two minor bugfixes

First bug:
File: 0001-Check-that-bounds-is-non-nil-in-semantic-ia-complete.patch

In semantic-ia-complete-symbol-menu in ia.el a check whether bounds are 
valid is missing. There is a check in semantic-ia-complete-symbol. The 
bug is triggered when completing something like
  myfun(
with empty prefix (see example in commit message).
Remark: In contrast to the code snippet in semantic-ia-complete-symbol I 
have used a let instead of having four (oref a bounds) evaluations. I 
also omitted the (goto-char (car (oref a bounds)), as delete-region 
already places point at this position.

Second bug:
File: 0001-Save-global-variable-wisent-lookahead-before-calling.patch

The wisent parser uses some global variables, which is a bit of a hassle 
considering that it calls itself (via EXPANDFULL and the like). If the 
last token of a recursive call does not match, it can corrupt the 
unmatched-syntax-cache or even lead to wrong parse results. If recursive 
calls of the parser are only done with parenthesised blocks and rules 
are accordingly, then the last token must be something like ')' and thus 
always matches and the bug is not triggered. For languages like fortran 
this is different.
I am very sure that the commit indeed fixes a bug and nothing more, but 
the wisent parser and its token stream organisation is a rather complex 
automaton, so I might have missed something.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-devel
Isak Andersson | 10 Feb 19:07 2015

Semantic questions for my language mode

Hello people!

I'm making my own mode for the Boo programming language, to replace the 
current one that existed because I wasn't quite happy with how the 
current one behaved.

I wanted to try and make one that integrates well with CEDET tools. So I 
was wondering a few things.

First, as auto indentation is quite the task since it pretty much 
requires some parsing to work reliably, I was wondering if it's possible 
to perhaps use the semantic parser to build an indentation system with 
and how one would go about doing so if it's possible.

Second, I was hoping it would be possible to somehow utilize semantic 
for building the syntax highlighting system as well. For example 
highlighting things based on what kind of type they are (function or 
variable). Boo also allows you to add new keywords by using macros, so 
if I could parse the project and detect macros and start highlighting 
macro invokations as keywords automatically (rather than manually like 
you do with the current boo-mode) that would be super swell. Would it be 
possible to do this?

Thanks!

Best regards,
Isak Andersson

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
David Engster | 7 Feb 13:27 2015
Picon

Buildbot updated

I've now configured the Buildbot to pull from the Git repository.

The main difference now is that it will build all branches, which is
pretty nice, since you can now check your branch by simply pushing it
upstream. The problem is that Buildbot's web status is pretty weak when
it comes to make sense of it all, as it does not display branch names on
most pages. I think the only overview page which does it is the "Grid":

http://randomsample.de:4455/grid

The other pages can at least be filtered by branch:

http://randomsample.de:4455/waterfall?branch=obsolete-eieio

http://randomsample.de:4455/waterfall?branch=master (currently none)

As you can see, we currently have problems with emacs-devel, which is
probably due to changes in hideif there. Also, we need to remove usage
of 'cl-symbol-macrolet', as it isn't available in Emacs 24.1.

I've removed the builders for Emacs23.x, as we do not support it
anymore.

-David

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/

Gmane