/usr/lib/falcon/parser/genparser/node.fal is in libfalcon-engine1 0.9.6.9-git20120606-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | /*
FALCON - The Falcon Programming Language
Generic Parser - Line oriented general rule based parser.
FILE: node.fal
The syntactic tree.
-------------------------------------------------------------------
Author: Giancarlo Niccolai
Begin:Tue, 17 Aug 2010 22:15:59 +0200
-------------------------------------------------------------------
(C) Copyright 2010: the FALCON developers (see list in AUTHORS file)
See LICENSE file for licensing details.
*/
import from struct.tree
node_text_type = "text"
node_top_type = "top"
function _isBlank( c )
return c == 0x20 or c == 0xD or c == 0xA or c == 0x8
end
class Node( type, text ) from struct.tree.Node( text )
type = type
/*# If true, will be moved notified to the renderer while processing. */
standout = false
add = self._nilAdder
function _nilAdder( data )
select data
case StringType
self.content = data
self.add = self._stringAdder
case Node
self.appendChild( data )
self.add = self._listAdder
default
raise ParseError( 10001, "Invalid data added to a node: " + data.describe() )
end
end
function _stringAdder( data )
select data
case StringType
self.content += data
case Node
n = Node( node_text_type, self.content )
self.appendChild( n )
self.appendChild( data )
self.content = nil
self.add = self._listAdder
default
raise ParseError( 10001, "Invalid data added to a node: " + data.describe() )
end
end
function _listAdder( data )
select data
case StringType
if self.lastChild.type == node_text_type
self.lastChild.content += data
else
self.appendChild( Node( node_text_type, data ) )
end
case Node
self.appendChild( data )
default
raise ParseError( 10001, "Invalid data added to a node: " + data.describe() )
end
end
end
class InfoNode( type, infos, standout ) from Node( type )
infos = infos
standout = standout ? true :false
end
class LevelNode( type, level, data ) from Node( type, data )
level = level
end
/*# A node that should standout.
This node is somewhere in the syntree, but it must be brougt to a general list of standout nodes.
Used for tocs, categories, footnotes and so on.
*/
class StandoutNode( type, data ) from Node( type, data )
standout = true
end
class TagNode( tagType, tagData ) from InfoNode( "tag", tagData )
tag = tagType
end
|