Hi All.
I try to understand how adding new language support works in SlickEdit
I'v read
http://blog.slickedit.com/2008/05/tutorial-adding-language-support-to-slickedit so I should be fine. But I'm not.
All I want to do is to enable tagging of my new languge. For the purpose of education I created new abstract language (called 'ala'), with source code extensions files (called 'ala' as well) that has only one keyword: 'function'.
I've created two source files (in attachments).
First (defs.ala) contains some function definition:
function func_1(arg)
{}
Second file (some_code.ala) just calls the function:
func_1(10);
I've created ala_proc_search(...) function in ala.e macro file.
I've created new project, added 'source' files to it and expected that Slick will tag this files correctly so when I search for references Slick will correctly show me that file defs.ala has func_1 definition and others func_1 references are just calls.
Or... the other way around... when I go into some_code.ala file and point my cursor on the func_1() and pick ''Go to definition of func_1" , I expected SlickEdit to direct me to defs.ala file with this definition.
Instead I get messge "Tag 'func_1' not found".
Why is that
I've checked that my ala_proc_search() function in ala.e file and verfied that it correctly parses symbol and split its name and type , where name is "func_1", and type is "function".
I call
tag_tree_compose_tag(symbol_name,'',ala_symbol_type,0,'','')
.
and assign its result to proc_name arg as I should.
By my code still doesn't work.
What am I missing ?
Could anybody help me please ?
I've attached all the files needed to run the example
My ala_proc_search code looks like this (debug lines cut off):
#define REGEX_PATTERN_1 '[ \t]*{function}[ \t]*{[a-zA-Z0-9_$]#} *'
int ala_proc_search(_str &proc_name, int find_first)
{
typeless status=0;
if ( find_first )
{
status=search('(function)','@rihwxsc');
}
else
{
status=repeat_search();
}
_str line='';
_str symbol_name='';
_str ala_symbol_type='';
for (;;)
{
if ( status )
{
return(status);
}
get_line(line);
if ( pos(REGEX_PATTERN_1,line,0,'R') )
{
ala_symbol_type = substr(line,pos('S0'),pos("0"));
symbol_name = substr(line,pos('S1'),pos("1"));
symbol_name=tag_tree_compose_tag(symbol_name,'',ala_symbol_type,0,'','');
if ( proc_name=='' )
{
proc_name=symbol_name;
}
else if ( proc_name :== symbol_name )
{
status=repeat_search();
continue;
}
return(0);
}
else
{
status=repeat_search();
}
}
}
I searched in SlickEdit documentation, on the web, I looked into other files in marco/ directory (most of the files are very complex and I'm only the beginner in Slick macro writting), but I still don't understand what am I missing.
If you can please help me. I am close to lose hope that I will make it work it at all.
P.S. hostfix for slickedit version 17.0.3 - change the number in hostfix.xml to mach your version of Slickedit
P.S.2 file ala.e has some debug code but it should be straitforward