medit/moo/mooedit/langs/yacc.lang

173 lines
5.4 KiB
Plaintext
Raw Normal View History

2006-08-26 06:17:24 -05:00
<?xml version="1.0" encoding="UTF-8"?>
2007-06-18 00:03:03 -05:00
<!--
2010-11-07 01:20:45 -08:00
Author: Yevgen Muntyan <emuntyan@sourceforge.net>
Copyright (C) 2006-2008 Yevgen Muntyan <emuntyan@sourceforge.net>
2007-06-18 00:03:03 -05:00
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-->
<language id="yacc" _name="Yacc" _section="Others" version="2.0">
<metadata>
<property name="mimetypes">text/x-yacc;text/x-bison</property>
2006-11-06 08:38:11 -06:00
<property name="globs">*.y;*.yacc</property>
<property name="line-comment-start">//</property>
<property name="block-comment-start">/*</property>
<property name="block-comment-end">*/</property>
</metadata>
2006-08-26 06:17:24 -05:00
<styles>
2008-03-02 12:35:50 -06:00
<!--FIXME make it better names, and make them translatable -->
2009-01-04 13:45:36 -06:00
<style id="keyword" _name="keyword" map-to="def:keyword"/>
<style id="token-type" _name="token-type" map-to="def:type"/>
<style id="rule" _name="rule" map-to="def:identifier"/>
2006-08-26 06:17:24 -05:00
</styles>
<definitions>
<context id="inline-c">
<start>^%{</start>
<end>^%}</end>
<include>
2008-02-25 07:31:55 -06:00
<context sub-pattern="0" where="start" style-ref="keyword"/>
<context sub-pattern="0" where="end" style-ref="keyword"/>
2006-12-31 04:54:51 -06:00
<context ref="c:c"/>
2006-08-26 06:17:24 -05:00
</include>
</context>
2008-02-25 07:31:55 -06:00
<context id="options" style-ref="keyword">
2006-08-26 06:17:24 -05:00
<prefix>^%</prefix>
2008-02-26 07:47:25 -06:00
<keyword>debug</keyword>
<keyword>defines</keyword>
<keyword>destructor</keyword>
<keyword>dprec</keyword>
2006-08-26 06:17:24 -05:00
<keyword>error-verbose</keyword>
<keyword>expect</keyword>
2008-02-26 07:47:25 -06:00
<keyword>glr-parser</keyword>
<keyword>initial-action</keyword>
2006-08-26 06:17:24 -05:00
<keyword>left</keyword>
2008-02-25 07:31:55 -06:00
<keyword>lex-param</keyword>
<keyword>locations</keyword>
2008-02-26 07:47:25 -06:00
<keyword>merge</keyword>
2008-02-25 07:31:55 -06:00
<keyword>name-prefix</keyword>
<keyword>no[_-]lines</keyword>
<keyword>nonassoc</keyword>
2008-02-26 07:47:25 -06:00
<keyword>output</keyword>
2008-02-25 07:31:55 -06:00
<keyword>parse-param</keyword>
2008-02-26 07:47:25 -06:00
<keyword>prec</keyword>
2008-02-25 07:31:55 -06:00
<keyword>pure[_-]parser</keyword>
<keyword>raw</keyword>
2008-02-26 07:47:25 -06:00
<keyword>require</keyword>
2006-08-26 06:17:24 -05:00
<keyword>right</keyword>
2008-02-25 07:31:55 -06:00
<keyword>start</keyword>
<keyword>token[_-]table</keyword>
<keyword>union</keyword>
</context>
2008-03-19 07:35:08 -05:00
<context id="token" end-at-line-end="true">
2008-02-25 07:31:55 -06:00
<start>^(%(token|type))(&lt;[A-Za-z_][A-Za-z0-9_]*&gt;)?(?![\w_-])</start>
<include>
<context sub-pattern="1" where="start" style-ref="keyword"/>
<context sub-pattern="3" where="start" style-ref="token-type"/>
2008-03-19 07:35:08 -05:00
<context ref="c:string"/>
<context ref="c:char"/>
<context ref="c:float"/>
<context ref="c:hexadecimal"/>
<context ref="c:octal"/>
<context ref="c:decimal"/>
<context ref="c:comment"/>
<context ref="c:comment-multiline"/>
2008-02-25 07:31:55 -06:00
</include>
</context>
<context id="before-grammar">
<include>
<context ref="inline-c"/>
<context ref="options"/>
<context ref="token"/>
<context ref="c:comment"/>
<context ref="c:comment-multiline"/>
</include>
</context>
<context id="after-grammar">
<start>^%%</start>
<include>
<context sub-pattern="0" where="start" style-ref="keyword"/>
<context ref="c:c"/>
</include>
</context>
<context id="c-with-brackets">
<include>
<context>
<start>{</start>
<end>}</end>
<include>
<context ref="c-with-brackets"/>
</include>
</context>
2008-03-19 07:35:08 -05:00
<context style-ref="keyword">
<match>(\$(&lt;[\w\d_-]*&gt;)?[\$0-9]|[@][$0-9])</match>
</context>
2008-02-25 07:31:55 -06:00
<context ref="c:c"/>
</include>
</context>
<context id="rule-code">
<start>{</start>
<end>}</end>
<include>
<context sub-pattern="0" where="start" style-ref="keyword"/>
<context sub-pattern="0" where="end" style-ref="keyword"/>
<context ref="c-with-brackets"/>
</include>
</context>
<context id="rule">
<start>[a-zA-Z_.][a-zA-Z0-9_.]*</start>
<end>;</end>
<include>
<context sub-pattern="0" where="start" style-ref="rule"/>
<context ref="c:comment"/>
<context ref="c:comment-multiline"/>
<context ref="c:char"/>
<context ref="c:string"/>
<context ref="rule-code"/>
</include>
2006-08-26 06:17:24 -05:00
</context>
<context id="grammar">
<start>^%%</start>
<include>
2008-02-25 07:31:55 -06:00
<context sub-pattern="0" where="start" style-ref="keyword"/>
<context ref="c:comment"/>
<context ref="c:comment-multiline"/>
<context ref="c:char"/>
<context ref="c:string"/>
<context ref="rule"/>
<context ref="after-grammar"/>
2006-08-26 06:17:24 -05:00
</include>
</context>
<context id="yacc">
<include>
2008-02-25 07:31:55 -06:00
<context ref="before-grammar"/>
2006-08-26 06:17:24 -05:00
<context ref="grammar"/>
</include>
</context>
</definitions>
</language>