Skip to content

Commit 79527ec

Browse files
asuttonjyasskin
authored andcommitted
Importing grammar elements.
1 parent befaf22 commit 79527ec

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

framework.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@
3737
<link rel="import" href="term.html"/>
3838
<link rel="import" href="publish.html"/>
3939
<link rel="import" href="range.html"/>
40+
<link rel="import" href="grammar.html"/>

grammar.html

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
2+
<!-- BNF Grammar block
3+
Use this tag to declare a fragment of a grammar specification.
4+
This sets block within an indented region of text and changes
5+
the default font-style to use italic.
6+
7+
Note that the spacing for the grammar is taken from the LaTeX
8+
version of the draft standard (or as well as I can interpret
9+
the spacing in LaTeX - a .9\textwidth minipage with tabs every
10+
.6 inches).
11+
12+
FIXME: We should pobably define a CXX class for these blocks.
13+
-->
14+
<polymer-element name="bnf-grammar">
15+
<template>
16+
<div style="font-style:italic;margin-left:.35in;">
17+
<content></content>
18+
</div>
19+
</template>
20+
<script>
21+
Polymer('bnf-grammar', {
22+
applyAuthorStyles: true,
23+
});
24+
</script>
25+
</polymer-element>
26+
27+
<!-- BNF rule
28+
Defines a BNF production.
29+
-->
30+
<polymer-element name="bnf-rule">
31+
<template>
32+
<span style="margin-left:.6in"><content></content>:<br/></span>
33+
</template>
34+
<script>
35+
Polymer('bnf-rule', {
36+
applyAuthorStyles: true,
37+
});
38+
</script>
39+
</polymer-element>
40+
41+
42+
<!-- BNF rule alternative.
43+
Indents the alternative beneath the rule name and applies
44+
a line break.
45+
-->
46+
<polymer-element name="bnf-alt">
47+
<template>
48+
<span style="margin-left:1.2in"><content></content></span><br/>
49+
</template>
50+
<script>
51+
Polymer('bnf-alt', {
52+
applyAuthorStyles: true,
53+
});
54+
</script>
55+
</polymer-element>
56+
57+
<!-- BNF terminal
58+
A terminal element in a BNF specification.
59+
-->
60+
<polymer-element name="bnf-terminal">
61+
<template
62+
><code style="font-style:normal"><content></content></code></template>
63+
<script>
64+
Polymer('bnf-terminal', {
65+
applyAuthorStyles: true,
66+
});
67+
</script>
68+
</polymer-element>
69+
70+
<!-- BNF optional element -->
71+
<polymer-element name="bnf-opt">
72+
<template><sub>opt</sub></template>
73+
<script>
74+
Polymer('bnf-opt', {
75+
applyAuthorStyles: true,
76+
});
77+
</script>
78+
</polymer-element>
79+
80+
<!-- Grammar terms
81+
A grammar term refers to a BNF production in the grammar.
82+
83+
TODO: Link grammar terms to their definitions?
84+
-->
85+
<polymer-element name="cxx-grammarterm">
86+
<template><i><content></content></i></template>
87+
<script>
88+
Polymer('cxx-grammarterm', {
89+
applyAuthorStyles: true,
90+
});
91+
</script>
92+
</polymer-element>

0 commit comments

Comments
 (0)