Creating Language Plugin not used for new language

Roland Plüss roland at rptd.ch
Mon Jul 16 18:27:21 BST 2018


So I take it then this is not supposed to be the usual way to do the
parser? From the look of it I though this is how it should be.

Anyways I figured out the problem. It had been actually the generated
DebugVisitor which threw me off. From the doc it is stated the incoming
QByteArray is UTF8. So I handled it like this. Problem now is that
DebugVIsitor expects a QString not a QByteArray which becomes a mess if
the source is actually UTF8. I got it working like this:

DebugVisitor( pLexer, QString::fromLatin1( pContents ) ).visitStart(
dspAst );

This is only for debuging and will show unicode as 2 characters instead
of 1 but it fixes the offset issue.


On 07/16/2018 06:59 PM, Friedrich W. H. Kossebau wrote:
> Am Montag, 16. Juli 2018, 18:40:07 CEST schrieb Roland Plüss:
>> I tried now getting this Lexer and some simple rules working using
>> KDevelop-PG-QT. I'm struggling hard with it since the documentation is
>> there but lacking in the details required to get it sucessfully implemented.
> If possible, please consider updating those docs you use where it fits. The 
> original authors of KDevelop-PG-QT are no longer around unless I am mistaken, 
> any recent activity on the code has been pure Qt5 porting and buildsystem 
> maintenance.
>
>> My main problem right now seems to be UTF8. I'm using a simple
>> test-script consisting of the typical header-GPL-notice, some empty
>> lines and one declaration line. The problem is that the
>> header-GPL-notice contains my name, and thus a UTF8 only character. The
>> Lexer seems to be thrown off my one character there resulting in the
>> lexing not working correctly. I have no clue though how I can fix this.
> Myself sadly has never even tried to write something using KDevelop-PG-QT, 
> only twisted some code in it itself to more modern code style. I can just 
> point to the two places still existing I know which make use of kdev-pg-qt:
> 	https://cgit.kde.org/kdevelop.git/tree/plugins/qmakemanager
> 	https://cgit.kde.org/kdev-php.git/tree/parser
> though I suspect you already found those.
>
> And hope somebody else is still on the mailinglist which has some deeper 
> insight and can help you here.
>
> No idea if https://techbase.kde.org/Development/KDevelop-PG-Qt_Introduction is 
> still relevant, but it has some comments about %input_encoding , just in case 
> you had really not seen that yet.
>
> Cheers
> Friedrich
>
>


-- 
Mit freundlichen Grüssen
Plüss Roland

Leader und Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Sowie verschiedene Blender Export-Skripts und Game-Tools

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180716/8e78624a/attachment-0001.sig>


More information about the KDevelop-devel mailing list