UDL for DXL (C LIke) Number processing issues.
-
@PeterJones I was looking thru the notepad online manual for the valid delimiter escape codes allowed.
This also applies to the close field too. In my case, I’d like to specify a non-printable character such as a tab along with a printable character such as space. Thus the open delimiter would be a period and when it parses to the end of the string and sees a “space” or “tab” after the string the escape or close part of the delimiter would stop the coloring and continue on to the end of the line. I realize there is a special ((EOL)) which isn’t mentioned n the user manual delimiter section. Are there any other undocumented special codes?
I have tried both the \t \r \n along with the hexadecimal codes ie. \0x020 for the space etc and none of these will work either.Also the npp+ keywords screen has the prefix checkbox for each one, it would be nice to have a postfix/suffix checkbox whereby one can check either one or both. I think this would eliminate the escape characters stated above but in the end both the escape characters and the check boxes would be great to have…
-
@swegmike said in UDL for DXL (C LIke) Number processing issues.:
@PeterJones I was looking thru the notepad online manual for the valid delimiter escape codes allowed.
There aren’t any, that I’m aware of.
This also applies to the close field too. In my case, I’d like to specify a non-printable character such as a tab along with a printable character such as space. Thus the open delimiter would be a period and when it parses to the end of the string and sees a “space” or “tab” after the string the escape or close part of the delimiter would stop the coloring and continue on to the end of the line.
As far as I know, that’s not possible.
I realize there is a special ((EOL)) which isn’t mentioned n the user manual delimiter section. Are there any other undocumented special codes?
Really? “Notice how UDL’s special operator
(( ))
transforms stringEOL
into an end of line character”. Yes, that’s in Ivan Radić’s site, not the npp-user-manual.org site, but that’s because Don agreed that Ivan’s documentation was so good that when we created npp-user-manual.org, we weren’t going to try to re-create it – it has been officially linked through the Define Your Language dialog since before npp-user-manual.org existed, and the npp-user-manual.org has throughout its existence always linked to Ivan’s site.Also the npp+ keywords screen has the prefix checkbox for each one, it would be nice to have a postfix/suffix checkbox whereby one can check either one or both. I think this would eliminate the escape characters stated above but in the end both the escape characters and the check boxes would be great to have…
This forum cannot help you with feature requests (I am sure you can find the forum’s FAQ on that topic). But, so you know, Notepad++ developers have shown no interest in adding new features to UDL in years, and have only rarely fixed bugs in it, despite the number of open UDL issues.
If you want more power than UDL offers, but don’t want to go so far as to write your own lexer plugin (which is the intended next step beyond UDL), there is the EnhanceAnyLexer plugin. It could handle some of your space/tab desires (as long as you just want to change the foreground color; it doesn’t have background colors, and cannot affect folding).
-
@PeterJones I pretty much have my first cut on the DXL language via UDL. I’ve also copied the “C” language parser since DXL is “C” like into a dxl.xml file and changed various entries from “C” to “DXL” etc. in the functionlist subdirectory for NPP. I’ve done the same using the “C” file in the autocomplete subdirectory but copied as DXL with the appropriate changes.
Here’s list of the files changed based on corresponding c.xml files or entries. I created the
language ID as 61 temporarily for the DXL language as also similarly in the roaming directory:autoCompletion/dxl.xml
functionList/dxl.xml
Notepad++/
functionList.xml
langs.model.xml
langs.xmlSo the goal here, is to get my DXL language, autocomplete list, and functionlist to show up in the NPP menubar->Language drop down list so that I can see it working for my DXL source code. However, DXL doesn’t showup in the Language list drop down. However, if I select the “C” language for use on my DXL source code, it will find the functions and display in the function list, and the autocomplete popup of keywords will show up. Along with applying the default “C” language colorization of the code.
Thus, what am I missing to get my “DXL” language to show up in the language drop down list vs. the UDL language entry based on dxl.xml colorization file?
Hopefully the NPP langs are hardcoded into the npp executable binary file.
-
@swegmike When I try to edit the post above for content and submit it, the forum thinks its spam…
-
UDLs show up below the line, under the User Defined Language menu – like the Markdown UDL
You cannot get a UDL to show up above the line, in the alphabetized section.
Hopefully the NPP langs are hardcoded into the npp executable binary file.
They are.
I created the language ID as 61 temporarily for the DXL language
UDLs do not get their own language ID – they are all handled by the UDL lexer. Just arbitrarily inserting that language ID into the other config files will not change that fact.
To make sure your DXL auto-complete and functionlist are working, all you have to do is activate the UDL selection for DXL.
-
I don’t see you listing the overrideMap.xml as a file that has a change, as is necessary for a UDL to associate the “proper” menu name entry with the UDL created xml file.
For instance, I’m able to associate the UDL that I created that connects all the files together with the overrideMap.xml file entry like so:
<association id= "dbaseplus.xml" userDefinedLangName="dBASEPlus"/> <association id= "dbaseplus.xml" userDefinedLangName="Dark_dBASEPlus"/>
This is clearly layed out in the documentation. Notice I have capitalized names that show in the menu, but they are linked to the dbaseplus.xml UDL file. This is possibly what you’re missing. Do make sure that the same case is used that you use to identify the UDL in the dxl.xml UDL file. The numbers, you say you’re using, are for the compiled languages that are in the Notepad++ object files, of which a UDL can not be.
I hope this helps, if not, please disregard.
-
@Lycan-Thrope I’ve looked at the overrideMap.xml and also noticed that the id name specifies the language with xml on the end. So in my case I would specify “dxl.xml” which is specified in the functionList and autoCompletion subdirectories.
However, the overrideMap.xml is not present when npp was installed so I’m not sure if I have to create one and where to put it. Most of the online docs specify testing things and shows a “powereditor” directory path which I don’t have nor this particular editor.
I did modify the functionList.xml file which is similar to the overrideMap.xml, but in the userdefined area it doesn’t show as examples that the id as “mylang.xml” but specifies “mylang_function” thus I had done this as “dxl_function” and inserted a copy of the “C” lang parser which specifies “c_function” as its id but I renamed it as “dxl_function” and the language as “DXL”. Moreover, this change was made to the dxl.xml files in the autoCompletion and functionList subdirectories.
So if I’m understanding you, the id must be “dxl.xml” and not “dxl_function” so it can find the files to use. But I’m not clear on whether I just edit the functionList.xml in the notepad++ directory or if I need to create an overrideMap.xml that has only my userdefined associations and parser in it and notepad will then use the functionList.xml for the other languages or use the overridMap.xml that only has my language when needed?
Moreover, the “C” language specifies c.xml in the autoComplete and functionList subdirs and yet the functList.xml for the id doesn’t specify “c.xml” but “c_function”
-
@swegmike I’ve changed the id from “dxl_function” to “dxl.xml” everywhere, and restared npp, and the one function my dxl code has doesn’t showup in the functionlist with the udl “dxl” selected as the language.
If I switch to the builtin “C” language and select view->function list, it finds my one function and displays it correctly in the functionlist.
So I dont know where the mismatch is for my DXL UDL and the files that I have changed.
I even copied the functionList.xml that was modified for the udl associations as overrideMap.xml and still can’t display the one function in the functionlist when I select dxl as the udl language, but it will showup when the “C” language is selected.
-
All these things – for the Function List with its override map, and the autoCompletion files, and where they all go – are described in the usermanual,
- Function List - https://npp-user-manual.org/docs/config-files/#function-list
- Auto Completion - https://npp-user-manual.org/docs/auto-completion/
I did modify the functionList.xml file which is similar to the overrideMap.xml,
Nope. The old
functionList.xml
is no longer used, starting with v7.9.2. Since you say you are on 8.4.6, you will never need to edit that file; if you have that file, delete it, as it will only confuse you, and will not do anything with v8.4.6.overrideMap.xml
goes in%AppData%\Notepad++\functionList
– it should exist with a fresh install, but if you updated from an ancient Notepad++ at some point, it might never have been created. In which case, I recommend copying the default one from a portable zipfile and putting it in the right location.So if I’m understanding you, the id must be “dxl.xml” and not “dxl_function” so it can find the files to use.
The ID in the
overrideMap.xml
must match your autoCompletion filename. If you autocompletion filename isdxl.xml
, then the id should bedxl.xml
. If your UDL’s name isDXL
, then theuserDefinedlangName
should be set toDXL
.<association id="DXL.xml" userDefinedLangName="DXL"/>
ID was a bad name for that attribute, IMO; it should have been “filename” or something.
dxl_function
That’s the standard nomenclature inside the Function List definition XML file (in your
dxl.xml
). It doesn’t need to match anything from overrideMap, but than it cannot match any of the internal IDs of any of the other languages’ functionList definitions.Think of it this way: Notepad++ reads overrideMap to find the filename, to be able to map the UDL name to a filename for the function list file. Then once it has that, Notepad++ reads the appropriate file from the
functionList\
folder to get the definition.Moreover, the “C” language specifies c.xml in the autoComplete and functionList subdirs and yet the functList.xml for the id doesn’t specify “c.xml” but “c_function”
That’s because the functionList.xml file was the old way of doing things, which has been irrelevant since v7.9.2. And neither the old functionList.xml nor the modern overrideMap.xml have any effect on the autoCompletion; autoCompletion has its own set of rules.
Most of the online docs specify testing things and shows a “powereditor” directory path which I don’t have nor this particular editor.
There is no official Notepad++ documentation that tells you to do anything with a “powereditor” directory path.
-
@PeterJones Yes, Ive been updating npp using its update feature. I would of thought npp would cleanup and get rid of old files for a given newer version.
So is langs.xml and langs.model.xml obsolete in the main program files directory ? They seem to have the same content and yet only the langs.xml shows up in the roaming directory.
I moved the overrideMap.xml to the functionList subdir for Program Files directory and the roaming directory and now it can find the one function in my DXL code and show it in the functionlist panel. Now I can modify the “C” language parser I reused for dxl and modify it as needed for dxl.
Moreover, when I delete my functions void attribute and start to retype it, the popup box appears like the “C” language does so I know autoCompletion works.
I can then modify this file for all my DXL builtin Attributes and functions (which there are quite a few) I’m not sure if I could make it also show the builtin constants and properties. Since these are quite large, and editing the xml file to keep it up to date is tedius everytime the language comes out with a new version, it would be great if the xml could point to them in my UDL keyword lists. Yes, I know this feature won;t be done…So here’s my one callback function list name although the void attribute doesn’t show up with the name in the functionlist panel even when its changed to “int”.
Moreover, operator overloading doesn’t show up with the :: although the function name after it does - so the my dxl parser will need fixing in time.void doGet(DB SectNo) { // used for apply()
void ::doGet(DB SectNo) { // used for apply()
-
@swegmike Here’s my overrideMap.xml entry for dxl
and an excerpt of the copied “C” language parser. However, there is a dxl.xml parser in the functionList subdir that duplicates this.
<association id= "dxl.xml" userDefinedLangName="DXL" /> <association id= "dxl.xml" ext=".dxl" /> <!-- ======================================================================== -->
An excerpt of the “C” lang parser for dxl.
<!-- =========================================================== [ DXL ] --> <!-- IBM DOORS Extension Language --> <parser displayName="DXL" id ="dxl.xml" commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`) (?s:\x2F\x2A.*?\x2A\x2F) # Multi Line Comment | (?m-s:\x2F{2}.*$) # Single Line Comment | (?s:\x22(?:[^\x22\x5C]|\x5C.)*\x22) # String Literal - Double Quoted | (?s:\x27(?:[^\x27\x5C]|\x5C.)*\x27) # String Literal - Single Quoted " >
-
@swegmike Here is the autoComplete excerpt for dxl too.
<NotepadPlus>
<AutoComplete language=“DXL”>
<Environment ignoreCase=“no” startFunc=“(” stopFunc=“)” paramSeparator=“,” terminal=“;” />
<KeyWord name=“#define” />I made the following changes in both the langs.xml and langs.model.xml using the “C” lang entry for dxl.
Not sure if this is needed or not!<Language name="dxl" ext="dxl" commentLine="//" commentStart="/*" commentEnd="*/"> <Keywords name="instre1">if else switch case default break goto return for while do continue typedef sizeof NULL</Keywords> <Keywords name="type1">void struct union enum char short int long double float signed unsigned const static extern auto register volatile bool uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t size_t time_t clock_t wchar_t FILE</Keywords> </Language>
-
@swegmike said in UDL for DXL (C LIke) Number processing issues.:
I made the following changes in both the langs.xml and langs.model.xml using the “C” lang entry for dxl.
Not sure if this is needed or not!Absolutely, positively not. The langs.xml is only for builtin lexers.
Here’s my overrideMap.xml entry for dxl
You do not need the second line. After v7.9.1, Notepad++ no longer uses the “ext” version.
Based on the recent questions about langs.xml and similar, you really need to read the entirety of https://npp-user-manual.org/docs/config-files/ . if this doesn’t answer your questions, read it again.
-
@swegmike just an FYI. When I try to edit one of my posts above within the 4 hour window, it thinks I’m spamming it. I can edit the last post, but a previous post by me or someone else on the forum that is posted already stops me from editing the post since it thinks my edit to correct spelling or wording is spam.
-
@swegmike Now that the autocomplete,functionlist and udl seem to be working. I think the best thing to do is to uninstall npp and reinstall to start with a fresh install since one doesn’t know which of the files have been deprecated. This will mean one having to reinstall all the pluggins too.
-
@swegmike ,
You’ve only got 19 posts to your credit, so it doesn’t consider you, yet, a frequent legitimate poster…just relax, it will come. It did the same thing to me when I started posting in the forums. :) -
@swegmike said in UDL for DXL (C LIke) Number processing issues.:
@swegmike Now that the autocomplete,functionlist and udl seem to be working. I think the best thing to do is to uninstall npp and reinstall to start with a fresh install since one doesn’t know which of the files have been deprecated. This will mean one having to reinstall all the pluggins too.
::Sigh::, such is the cost of trial and error and mucking about in an environment one is learning. :) Welcome to the madhouse. :)
-
@swegmike said in UDL for DXL (C LIke) Number processing issues.:
When I try to edit one of my posts above within the 4 hour window
I believe it is because you had 0 reputation up until now. Editing privileges require that you have at least 1 upvote on a post. I just gave you one.
Please do not abuse the editing feature: in general, it is considered rude to edit a post in a way that makes future replies not make sense any more. Fixing minor typos is reasonable; changing the meaning of an earlier post, especially after people have replied, is highly frowned upon.
-
@PeterJones my edits on this and other forums are editorial since once I read what I posted, it may not be clear. Some times spell checkers override what one posts and my laptop keys sometimes don’t work depending on the key (10+ year old company laptop).
An update, for future npp users doing UDL stuff.
I used windows 8.1 to uninstall npp and answered yes to all questions to not retain config data. Upon looking at what remained, there was still some subdirs including the NppShell_06.dll. I manually deleted everything, but the dll required me to log out and back in since something was locking it.Moreover, the roaming directories and files weren’t removed. To prevent confusion, I had to remove these after reinstall of the current version of npp, delete them by selecting them by using the npp “open the user defined language folder” and go up and down the directories to select and delete them (the fastest way I know). Starting npp again doesn’t recreate them. Thus I had to reinstall npp again so that the roaming directories get recreated etc. There is no npp repair feature.
Upon reviewing what the program files npp directory contents and roaming directories contained, the following were noted.
a). the roaming directory contains “UserDefinedLangs” subdir but not the program files npp directory as older versions created. Thus I copied all my backup UDLS to the UDL"open the user defined language folder" and pasted them to this directory.
b). the overrideMap.xml is in the program files “functionList” subdir now upon a new install. Apparently doing updates on older npp versions are missing this part of the update to put this file there but will upon a clean install. Moreover, the functionList subdir isn’t in the roaming area of npp anymore upon a clean install.
c). The program files contained langs.model.xml and the old version of langs.xml which isnt there anymore; however, the roaming directory only contains the langs.xml and not the langs.model.xml even though all of them contain the same info. So npp has two different filenames that serve the same purpose with the only difference being which directory they are in - the Program files vs. the roaming directory.Thus, the summary for future reference is,
a) roaming contains these subdirs only.
backups
plugins
themes
userDefinedLangs
b). Program files notepad++ subdir contains these subdirs only.
autoCompletion
functionList
localization
plugins
themes
updater
c). various xml file differences mentioned herein.Now for new issues…
-
@swegmike my new issues which may not in the end be an issue are.
a). In developing my UDL xml file for DXL, I have multiple versions. The xml file names are different
IE.
DXL.xml
DXL_p.xml
DXL-rt.xml
DXL_rt1.xml
DXL_rt2.xmlnote: originally I called rt2 as rt1.1. However, the npp and the UDL docking panel lists wont display rt1.1 as such but will show it as rt1. However, rt1 is a different file so one must keep track of the two even though both are displayed.
Although I can select each under the npp UDL language selection and they will be applied to my DXL code, the issue is with the functionlist (my favorite headache).
I do have different xml filenames in the Program File->notepad+±>functionList subdir as i.e.
dxl.xml and dxl_p.xml.
I’ve edited the overrideMap.xml as follows where they are two different id’s that specify these filenames although the userdefinedlanguage value is “DXL” for both as follows. Note: the overrideMap.xml doesn’t contain the parsers anymore like the old file mentioned in earlier posts.<association id= "dxl.xml" userDefinedLangName="DXL"/> <association id= "dxl_p.xml" userDefinedLangName="DXL"/>
My functionList parser for the my two different DXL versions for development purposes specify this
dxl.xml
NotepadPlus>
<functionList>
<!-- =========================================================== [ DXL ] -->
<!-- IBM DOORS Execution Language -->
<parser
displayName=“DXL”
id =“dxl.xml”
commentExpr="(?x) # Utilize inline comments (seeRegEx - Pattern Modifiers
)
(?s:\x2F\x2A.?\x2A\x2F) # Multi Line Comment
| (?m-s:\x2F{2}.$) # Single Line Comment
| (?s:\x22(?:[^\x22\x5C]|\x5C.)\x22) # String Literal - Double Quoted
| (?s:\x27(?:[^\x27\x5C]|\x5C.)\x27) # String Literal - Single Quoted
"
>The second file is the same except the id=“dxl.xml”
Moreover, the autoCompletion directory will also contains two different DXL files dxl.xml and dxl_p.xml although they don’t contain an ID but the same entry
<AutoComplete language=DXL">
Hence the issue is that upon selecting which dxl UDL version to apply to my source code and then trying to run the functionlist, npp seems to hang forever and won’t display the one function I have in my dxl source code.
Opinion: is that even the xml filenames are different across the functionList and autoComplet subdirs and the id’s specified are different, npp gets hung up on the share language name DXL.