<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Class: Farts::AttributeSyntaxNode</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Class</strong></td> <td class="class-name-in-header">Farts::AttributeSyntaxNode</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> <a href="../../files/lib/farts/farts_parser_rb.html"> lib/farts/farts_parser.rb </a> <br /> </td> </tr> <tr class="top-aligned-row"> <td><strong>Parent:</strong></td> <td> <a href="SyntaxNode.html"> SyntaxNode </a> </td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="diagram"> <map id="map" name="map"> <area shape="rect" coords="665,101,761,149" href="SyntaxNode.html" alt="SyntaxNode " /> <area shape="rect" coords="27,197,157,245" href="LiteralSyntaxNode.html" alt="LiteralSyntaxNode " /> <area shape="rect" coords="181,197,323,245" href="ProgramSyntaxNode.html" alt="ProgramSyntaxNode " /> <area shape="rect" coords="347,197,491,245" href="AttributeSyntaxNode.html" alt="AttributeSyntaxNode " /> <area shape="rect" coords="515,197,616,245" href="IfSyntaxNode.html" alt="IfSyntaxNode " /> <area shape="rect" coords="640,197,787,245" href="CommentSyntaxNode.html" alt="CommentSyntaxNode " /> <area shape="rect" coords="811,197,925,245" href="EndSyntaxNode.html" alt="EndSyntaxNode " /> <area shape="rect" coords="949,197,1096,245" href="LocalVarSyntaxNode.html" alt="LocalVarSyntaxNode " /> <area shape="rect" coords="1120,197,1235,245" href="CallSyntaxNode.html" alt="CallSyntaxNode " /> <area shape="rect" coords="1259,197,1408,245" href="CommandSyntaxNode.html" alt="CommandSyntaxNode " /> <area shape="rect" coords="412,5,511,53" href="../Racc/Parser.html" alt="Racc::Parser " /> <area shape="rect" coords="425,101,497,149" href="Parser.html" alt="Parser " /> <area shape="rect" coords="540,5,647,53" href="../StringScanner.html" alt="StringScanner " /> <area shape="rect" coords="557,101,629,149" href="Lexer.html" alt="Lexer " /> <area shape="rect" coords="236,101,308,149" href="Lib.html" alt="Lib " /> <area shape="rect" coords="33,101,119,149" href="Interpreter.html" alt="Interpreter " /> <area shape="rect" coords="16,65,1419,256" href="../Farts.html" alt="Farts " /> </map> <img src="../../dot/f_21.png" usemap="#map" border="0" alt="dot/f_21.png"> </div> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> <a href="#M000327">execute</a> <a href="#M000326">new</a> </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> <div id="method-M000326" class="method-detail"> <a name="M000326"></a> <div class="method-heading"> <a href="#M000326" class="method-signature"> <span class="method-name">new</span><span class="method-args">( lineno, vname, vattr )</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000326-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000326-source"> <pre> <span class="ruby-comment cmt"># File lib/farts/farts_parser.rb, line 769</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">lineno</span>, <span class="ruby-identifier">vname</span>, <span class="ruby-identifier">vattr</span> ) <span class="ruby-keyword kw">super</span> <span class="ruby-identifier">lineno</span> <span class="ruby-ivar">@vname</span> = <span class="ruby-identifier">vname</span> <span class="ruby-ivar">@vattr</span> = <span class="ruby-identifier">vattr</span> <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <h3 class="section-bar">Public Instance methods</h3> <div id="method-M000327" class="method-detail"> <a name="M000327"></a> <div class="method-heading"> <a href="#M000327" class="method-signature"> <span class="method-name">execute</span><span class="method-args">(intp)</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000327-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000327-source"> <pre> <span class="ruby-comment cmt"># File lib/farts/farts_parser.rb, line 775</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">intp</span>) <span class="ruby-keyword kw">begin</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">intp</span>.<span class="ruby-identifier">vars</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-ivar">@vname</span>) <span class="ruby-identifier">intp</span>.<span class="ruby-identifier">vars</span>[<span class="ruby-ivar">@vname</span>].<span class="ruby-identifier">send</span>(<span class="ruby-ivar">@vattr</span>.<span class="ruby-identifier">intern</span>) <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">fart_err</span>(<span class="ruby-node">"unknown local variable '#{@vname}'"</span>) <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span> <span class="ruby-identifier">fart_err</span>(<span class="ruby-identifier">$!</span>.<span class="ruby-identifier">message</span>) <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> </div> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>