<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ghost23 Blog &#187; Codeparser</title>
	<atom:link href="http://www.ghost23.de/category/codeparser/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghost23.de</link>
	<description>A blog about Flash and stuff</description>
	<lastBuildDate>Tue, 03 Jan 2012 15:21:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Abstract source code representation</title>
		<link>http://www.ghost23.de/2010/03/abstract-source-code-representation/</link>
		<comments>http://www.ghost23.de/2010/03/abstract-source-code-representation/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 09:57:15 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=271</guid>
		<description><![CDATA[Juten Tach, shame on me for thinking &#8211; even just for a second &#8211; i could have been the first one with this idea. Of course not . As commenter Ben pointed out, there are thoughts about this subject already and they exist for some time now. There is Intentional Programming. IP has a lot [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>shame on me for thinking &#8211; even just for a second &#8211; i could have been the first one with <a href="http://www.ghost23.de/2010/03/source-code-stored-in-object-structures/">this idea</a>. Of course not <img src='http://www.ghost23.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . As commenter Ben pointed out, there are thoughts about this subject already and they exist for some time now.</p>
<p>There is <a href="http://en.wikipedia.org/wiki/Intentional_programming" target="_blank">Intentional Programming</a>. IP has a lot more in it than just the fact, that is proposes to have an abstract representation of code be stored instead of concrete code in text files. But the abstract representation seems to serve as a kind of basis for the whole thing. Intentional Programming is brought forward by <a href="http://www.intentsoft.com/" target="_blank">Intentional</a>, who are working on a software development system around the ideas of IP. They did a <a href="http://msdn.microsoft.com/en-us/data/dd727740.aspx" target="_blank">presentation</a> on the DSL DevCon 2009, which is a bit lengthy, but nevertheless awesome. Martin Fowler also wrote down some <a href="http://martinfowler.com/bliki/IntentionalSoftware.html" target="_blank">thoughts</a> on Intentional and their solution.</p>
<p>Then there is <a href="http://en.wikipedia.org/wiki/Semantic-oriented_programming" target="_blank">SOP</a> and a <a href="http://symade.tigris.org/" target="_blank">tool in early alpha stage</a>. Can&#8217;t say too much about it, as the guy is a Russian and Google Translate does not a very good job at translating from russion to german <img src='http://www.ghost23.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And lastly, there is another <a href="http://martinfowler.com/articles/languageWorkbench.html" target="_blank">good article</a> from Martin Fowler on the subject in general, which goes way beyond, what i am currently thinking about. Means, i am still at the stage of technical ideas and he is already taking the whole thing into the business world as well as Intentional does.</p>
<p>All this is truly inspiring. Would love to see something like this for Flash, i think it also could be the answer for true designer / developer collaboration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/03/abstract-source-code-representation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Source code stored in object structures</title>
		<link>http://www.ghost23.de/2010/03/source-code-stored-in-object-structures/</link>
		<comments>http://www.ghost23.de/2010/03/source-code-stored-in-object-structures/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 21:41:58 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=266</guid>
		<description><![CDATA[Juten Tach, there is a topic i&#8217;ve been thinking about lately, which is source code and the way we store it currently. Specifically, i do wonder, if storing source code as text is still the right way. Especially for languages, which are not run in an interpreted way, but compiled or pre-compiled i wonder, why [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>there is a topic i&#8217;ve been thinking about lately, which is source code and the way we store it currently. Specifically, i do wonder, if storing source code as text is still the right way. Especially for languages, which are not run in an interpreted way, but compiled or pre-compiled i wonder, why we actually store that code in text files.</p>
<p>If you look at all the tools we use, the IDEs, the compilers, UML modelling applications. All these tools currently take textual code and transform it into intermediate object structures, with which they work. Take code highlighting. For being able to have proper code highlighting, tools have to parse the text, understand the very basics of the structure of the code in order to do the highlighting.</p>
<p>Take code completion. The tool has to parse the textual source code into some kind of object structure in order to understand, what references, functions or objects to offer.</p>
<p>Take refactoring. The tool has to parse the textual source code into an object structure in order to change namings, move functions into different classes while updating the references and organizing imports and so on.</p>
<p>Take UML reverse engineering. The tool has to parse the textual source code into an object structure in order to build the represented class hierarchy that serves as the basis for visualizing that hierarchy in UML. All these tools work with object structures or syntax trees rather than with the text itself. Alle these tools have to parse the text over and over again.</p>
<p>In the end, that&#8217;s also, what the compiler does before it transforms the whole thing into binary instructions. So, i ask myself, wouldn&#8217;t it be more efficient to actually store the source code in some kind of object structure, so that these tools can make direct use of it instead of having to parse it again and again?</p>
<p>Googling this subject (i was not even sure, what to search for, because i couldn&#8217;t decide on good search terms), i only found <a href="http://c2.com/cgi/wiki?ProgramsAreDatabases" target="_blank">one wiki article</a>, that discussed that topic a little bit, but differently, as that the people there thought about storing source code in databases, which i am not so sure, whether this is the best way. But the thoughts behind that go into the same direction.</p>
<p>I understand, that storing source code in text files has some significant advantages, the most obvious being, that everyone can read text files, because it is so standard and minimal. Also, source code repositories make use of text and can handle it very intelligently.</p>
<p>But i think, since software applications today become more and more complex, wouldn&#8217;t development environments, that handle source code as object structures from the very start, be capable of handling that source code more efficiently and even more intelligently? If we would start thinking about source code as being a model and a textual representation of that model simply being one view (UML being another), wouldn&#8217;t that provide completely new possibilities for IDEs and the whole ecosystem of software development? In respect to MVC, doesn&#8217;t source code stored in text files currently strongly couple the model with the view, something we normally try to avoid as hard as we can? Things like indentation, the use of braces or brackets, specials keywords, semicolons and blank lines, aren&#8217;t these just visual decorations, either in order for us to be able to read the code or for the parser to parse it? Imagine, how code could look like, if we wouldn&#8217;t need those things, because we wouldn&#8217;t need a text parser.</p>
<p>Have you found articles on that topic? Would be curious to see them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/03/source-code-stored-in-object-structures/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Little talk about ANTLR at the next Flex UG Meeting in Hamburg</title>
		<link>http://www.ghost23.de/2008/05/little-talk-about-antlr-at-the-next-flex-ug-meeting-in-hamburg/</link>
		<comments>http://www.ghost23.de/2008/05/little-talk-about-antlr-at-the-next-flex-ug-meeting-in-hamburg/#comments</comments>
		<pubDate>Tue, 13 May 2008 07:20:48 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[antlr]]></category>
		<category><![CDATA[antlrworks]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flexughh]]></category>
		<category><![CDATA[stubcodegenerator]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/blog/?p=81</guid>
		<description><![CDATA[I am going to give a little talk about my first experiences with ANTLR at the next Flex Usergroup Meeting in Hamburg.
]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,<br />
since Jens also <a href="http://www.flexughh.de/2008/05/12/lets-talk-about-antlr/" target="_blank">announced</a> it, i thought i tell you from here, too. I am going to give a little talk about my first experiences with <a href="http://www.antlr.org">ANTLR</a>. I think it&#8217;s a great tool for building Domain Specific Languages and the community around ANTLR is quite big and engaged.<br />
I will show my first little personal project i did with ANTLR, the <a href="http://www.ghost23.de/blogarchive/2008/04/stubcodegenerat.html">StubCodeGenerator</a>. I will also show what you need to get started, how to develop grammars with <a href="http://www.eclipse.org/">Eclipse</a> and <a href="http://www.antlr.org/works/index.html">ANTLWorks</a> and a littlebit about grammars in general.<br />
So if you happen to be in Hamburg at the 19th of May, feel free to come. Details of the Flex usergroup meeting can be found <a href="http://www.flexughh.de/2008/04/17/nachstes-meeting-mittwoch-21052008/" target="_blank">here</a> (german language).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2008/05/little-talk-about-antlr-at-the-next-flex-ug-meeting-in-hamburg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My experiences with ANTLR</title>
		<link>http://www.ghost23.de/2008/04/my-experiences-with-antlr/</link>
		<comments>http://www.ghost23.de/2008/04/my-experiences-with-antlr/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 20:27:31 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[AS3 / Flex]]></category>
		<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[antlr]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[stubcodegenerator]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/blog/?p=78</guid>
		<description><![CDATA[I have summarized my experiences with ANTLR i gained for my first little project i built using ANTLR.
]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,<br />
i wanted to summarize my first experiences with ANTLR a little bit. I have just <a href="http://www.ghost23.de/blogarchive/2008/04/stubcodegenerat.html">recently</a> finished my first little project for generating <a href="http://code.google.com/p/stubcodegenerator/" target="_blank">stub code</a> for languages like Java or Actionscript. It was only a little project, but it had some interesting bits in it, that made it a good exercise. By the way, the whole sourcecode is available there, including the grammar. Everything&#8217;s running under the BSD license, so feel free to have a look at it.<br />
First of all, my grammar uses indentation for building a hierarchy, a little bit like python does. So in order to build nested structures, you do not use brackets or braces, instead the parser has to find that out by the indentation level. This doesn&#8217;t seem to be a big deal, but it is tricky, since it is not easy to find the beginning and ending of a nested block, because there are no dedicated symbols representing them. So you have to count the tabs and tell, if there are more tabs then there were before and decide, if this means, that the indentation level has increased or decreased and with that information you make up your nested structures.<br />
ANTLR then allows you to emit virtual tokens (tokens stand for a &#8216;kind&#8217; of character or character sequence eg.) like a &#8220;INDENT&#8221; token or &#8220;DEDENT&#8221; token, that you emit yourself, once you have recognized, that the indentation level has changed.<br />
Trying to solve these issues i have included a lot of code in my grammar. I feel, this is not right, though. Actually i would think, a grammar should ideally have no concrete code at all in order to be completely portable to whatever target language you want (target language here means the language in which you want to develop your parser with and should not be confused with the language, that you are actually building your grammar for). But in my grammar, i have a lot of java code now and i have not yet found a different way of working around that.<br />
The Extended-Backus-Naur-form (notation for defining grammars) has limits in what you can define and especially if it comes to making decisions based on information, that came long before in the stream of characters or might just come way ahead, than you can&#8217;t solve this without writing additional code (as far as i know at the moment, that is).<br />
But besides that, i&#8217;m really fascinated about this whole field. I guess after this one, i can try for something more complex. I have already searched for the grammar of Actionscript3 in the net, but no real hit yet. I thought i&#8217;d find the grammar in the opensource package for the flex sdk, but haven&#8217;t found it yet. Adobe has put the Flex Builder in the list of ANTLR showcase projects, so i am curious, where Adobe uses ANTLR there. Of course it would be great to be able to use the original Actionscript3 grammar from Adobe to build individual tools around Actionscript. If anyone has more information on this, please drop a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2008/04/my-experiences-with-antlr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StubCodeGenerator &#8211; generates stubcode for AS3</title>
		<link>http://www.ghost23.de/2008/04/stubcodegenerator-generates-stubcode-for-as3/</link>
		<comments>http://www.ghost23.de/2008/04/stubcodegenerator-generates-stubcode-for-as3/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 22:17:48 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[AS3 / Flex]]></category>
		<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[antr]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[stubcodegenerator]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/blog/?p=77</guid>
		<description><![CDATA[Juten Tach, finally it&#8217;s done. My first little project using ANTLR. Tataaa, i present StubCodeGenerator. Actually it is just a little tool to generate stub classes and interfaces within nested package structures for you to start a project. It is midnight here now, so i will write some more details later, but i encourage you [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,<br />
finally it&#8217;s done. My first little project using ANTLR. Tataaa, i present StubCodeGenerator. Actually it is just a little tool to generate stub classes and interfaces within nested package structures for you to start a project. It is midnight here now, so i will write some more details later, but i encourage you to visit the project at <a href="http://code.google.com/p/stubcodegenerator/" target="_blank">http://code.google.com/p/stubcodegenerator/</a>. You also find more details on how to use it, there. Hope you enjoy playing with it. I would appreciate any comments you have on the tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2008/04/stubcodegenerator-generates-stubcode-for-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ANTLR grammar support in eclipse</title>
		<link>http://www.ghost23.de/2008/04/antlr-grammar-support-in-eclipse/</link>
		<comments>http://www.ghost23.de/2008/04/antlr-grammar-support-in-eclipse/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 13:30:25 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[antlr]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[parser]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/blog/?p=72</guid>
		<description><![CDATA[There is an eclipse plugin available now for writing ANTLR v3 grammars.
]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,<br />
just a small post to say, that there is an eclipse plugin for ANTLR v3 grammars. It&#8217;s still in beta but it already looks very nice and helps a lot in writing grammars. Check it out here:<br />
<a href="http://antlrv3ide.sourceforge.net/" target="_blank">http://antlrv3ide.sourceforge.net/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2008/04/antlr-grammar-support-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ANTLR gets Actionscript3 Target</title>
		<link>http://www.ghost23.de/2008/03/antlr-gets-actionscript3-target/</link>
		<comments>http://www.ghost23.de/2008/03/antlr-gets-actionscript3-target/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 08:23:00 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[AS3 / Flex]]></category>
		<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[antlr]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[translator]]></category>
		<category><![CDATA[übersetzer]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/blog/?p=70</guid>
		<description><![CDATA[ANTLR, the parser generator now has a new target language, it supports. Actionscript3.
]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,<br />
already in january George Scott and JP St. Pierre added a new target for ANTLR, one of the toys i am playing with at the moment (more to come soon, hopefully). For those who do not know, ANTLR is a powerfull parser generator with many target languages, the default being Java, but they also have C, C++, C# and lots more. The new target is Actionscript3. It is still alpha. This is a great idea and i will definitely try it out. More info here:<br />
<a href="http://www.antlr.org/wiki/display/ANTLR3/Antlr3ActionScriptTarget" target="_blank">http://www.antlr.org/wiki/display/ANTLR3/Antlr3ActionScriptTarget</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2008/03/antlr-gets-actionscript3-target/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Model driven development</title>
		<link>http://www.ghost23.de/2008/01/model-driven-development/</link>
		<comments>http://www.ghost23.de/2008/01/model-driven-development/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 09:27:23 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[repository]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/blog/?p=66</guid>
		<description><![CDATA[Martin Fowler presents a very nive idea about model driven devlopment and repository based code, which i was thinking about for a while, too.
]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p><strong>[Update]</strong>: Martin is not using the term &#8220;Repository Based Code&#8221; anymore. He&#8217;s now calling it: <a href="http://martinfowler.com/bliki/ProjectionalEditing.html" target="_blank">Projectional Editing</a>.</p>
<p>great article from Martin Fowler about <a href="http://martinfowler.com/bliki/RepositoryBasedCode.html" target="_blank">repository based code</a> and model driven development. This is something, i am thinking about for some time, too.</p>
<p>Let&#8217;s face it, all our development tools we use every day are taking our text based source code and parse it into something, that these tools can understand. It begins with syntax highlighting, over autocompletion, refactoring and ends with actual compiling into the executable.</p>
<p>At all these stages, the involved tools need to parse the text and make it into an abstract model, with which the tool can work. So the idea with repository based systems is, why do we actually store our source code in a textual form, why not saving the abstract model right away and let our tools directly work with it without the need of parsing text over and over again? And for editing, why not simply show an individual representation of that abstract model to the user, like text form or uml form or whatever you need?</p>
<p>This idea is fascinating me pretty much, because i think, it makes totally sense and could leverage the efficiency of all the tools, we are working with, since the parsing process could be avoided and make the tools much faster.</p>
<p>Of course, there are drawbacks. Code repositories today work best with text based source code, but saving an abstract model would probably be done in some binary format for performance reasons. It would mean, that you loose all those nice merging capabilities, that tools like subversion offer. One would have to find a solution to that problem, but dispite that, i really like the general idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2008/01/model-driven-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grammatiken mit ANTLR</title>
		<link>http://www.ghost23.de/2007/11/grammatiken-mit-antlr/</link>
		<comments>http://www.ghost23.de/2007/11/grammatiken-mit-antlr/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 20:46:06 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Codeparser]]></category>
		<category><![CDATA[antlr]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[translator]]></category>
		<category><![CDATA[übersetzer]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/blog/?p=57</guid>
		<description><![CDATA[Ich mache meine ersten Schritte mit ANTRL, dem Übersetzungsgenerator.
]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>ich beschäftige mich gerade ein wenig mit Übersetzergeneratoren. Da gibt es ja viele, man kennt z.B. Yacc, oder JLex usw. Ich schaue mir momentan <a href="http://www.antlr.org" target="_blank">ANTLR</a> an. Alles sehr spannend. Ich habe mir &#8211; was ich sonst eher selten mache &#8211; tatsächlich auch mal ein <a href="http://www.amazon.de/gp/product/0978739256" target="_blank">Buch</a> dazu gekauft. Sehr lesenswert. Cool ist auch, dass auf der Website von antlr ein tolles Tool namens ANTLRWorks zur Verfügung steht, mit dem man Grammatiken entwickeln, ausprobieren und debuggen kann, das erleichtert die ersten Schritte.</p>
<p>Was ich aber gleich erfahren musste ist, dass man mit fast allen heutigen gebräuchlichen Grammatiken nur kontextfreie Sprachen beschreiben kann. Kontextfreie Sprachen sind solche, die in sich z.B. keine Referenzen verwenden, in denen sich also platt gesagt in einem Satz alles direkt erklärt und nicht auf Sachverhalte verwiesen wird, die man in einem anderen Satz gesagt hat. Nun sind ja aber fast alle heutigen Programmiersprachen kontextbehaftet, schon allein dadurch, dass es z.B. Variablen gibt. Wenn ich also schreibe:</p>
<pre>var i:Number = 10;
trace(i + 5);</pre>
<p>dann beziehe ich mich in der zweiten Zeile auf eine Variable, die in der ersten Zeile deklariert wurde, also ist die zweite Zeile ohne den Kontext der Ersten nicht auswertbar.</p>
<p>Um diesem Umstand Rechnung zu tragen, arbeitet man dann mit Code, z.B. mit Hashmaps, um sich solche Kontexte zu merken, z.B. solche Variablendeklarationen. Und das finde ich auf den ersten Blick eigentlich gar nicht so schön, denn das bedeutet, dass ich in die Grammatik, die ja normalerweise in einer programmiersprachenübergreifenden Notation gehalten ist (z.B. der EBNF Notation), konkreten Code einer bestimmten Programmiersprache einfügen muss, um z.B. die Hashmaps zu verwalten. Was ich schade finde, denn so kann die Grammatik nicht unabhängig von der dem zu generierenden Parsercode zugrunde liegenden Sprache erstellt werden.</p>
<p>Muss ich mich wohl einfach mit abfinden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2007/11/grammatiken-mit-antlr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

