[ Avaa Bypassed ]




Upload:

Command:

www-data@3.22.63.154: ~ $
<?xml version="1.0" encoding="UTF-8"?>

<!--

 Author: Vlad Ionescu
 Copyright (C) 2013 Vlad Ionescu <imbvlad@gmail.com>

 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.

***

 This is meant to be a syntax highlighting *.lang file working for gedit or other text editors using this sort of filetype. The reference is LTspice, almost exclusively, but the program is compatible with SPICE3 syntax or with many other flavours of SPICE.
 LTspice can be set to have tabs or fixed font, but the color scheme is a very simple one: dark-green for comments, red for concatenated line, blue for any dot-command and black for the rest. While this doesn't put strain on the eyes color-wise, it does have a tendency to make following certain aspects a tad harder, such as parameters in a large .param block or trying to find a .subckt in a netlist.
 The methods used here are simple enough not to make everything look like a rainbow but, at the same time, to not be too simple, while trying to emphasize some key words to make editing of netlists with a text editor easier. Thus, all ennumerated below share one colour each, common or not (configurable):
  - comments and in-line comments
  - elements' names, model names or attributes
  - variables
  - dot-commands:
    * parameters, functions
    * simulation cards
    * subcircuits and models
    * other directives
  - subcircuit's or model's names

2013.06.15  - A-devices model names are now detected within concatenated lines.
2013.06.17  - Functions are detected "by the book" (.func f(x) {...}) with matching curled braces.
2013.11.21  - Added COUNTER to A-devices.
2014.04.08  - Corrected variable detection with opened parenthesis behing and no space: (Ron=...)
2014.04.22  - Only variables are now highlighted, without "="
            - Corrected highlighting of "table()"
            - Added *.mod to the extension list (model files)
2014.04.25  - Elements are correctly marked when preceeded by spaces.
            - Subcircuits ending in a simple ".ends" are now correctly detected.
2014.05.29  - Added markup for "params:" within a ".subckt" line.
2014.05.31  - Improved markup for "VALUE" syntax in E or G sources.
2014.06.23  - Added markup for old-style "Laplace" in E or G sources.
2015.04.30  - Added markup for "params:" in a concatenated .subckt line.
2015.11.02  - Added upper-case extension recognition.
2015.11.27  - Added OTA to A-devices.
2015.12.26  - Added exception for coupling coefficient k
2018.12.19  - Added markup for ".parma".
            - Added support for the state-machine.
            - Corrected keyword "xor" (zor) and added "ota" to A-devices.
            - Fixed highlighting of variables without "=" afterwards.  TODO
            - Made functions highlight the name only, without the parenthesis and within.
2019.01.02  - Added markup for ".text"
2021.07.31  - Modified the mimetypes and globs section
2021.10.10  - Corrected the state machine id and style

********************************************************************************

  There is also a colour scheme, spice.xml, which makes the highlighting resemble LTspice's editor, see:
  
http://ltspicegoodies.ltwiki.org/useful.php

for an html preview. It's completely optional, but it can't be hosted in the GtkSourceView's repository. The file can be downloaded from the same page.

********************************************************************************

-->

<language id="spice" name="SPICE" version="2.0" _section="Scientific">


<!-- The known netlist formats used by LTspice (and not only): *.sp, *.net, *.cir, *.sub, *.lib, *.mod -->
<metadata>
  <property name="globs">*.cir;*.CIR;*.Cir</property>
</metadata>

<styles>
  <style id="preprocessor" name="Preprocessor" map-to="def:preprocessor"/>
  <style id="statement" name="Statement" map-to="def:statement"/>
  <style id="function" name="Function" map-to="def:function"/>
  <style id="builtin" name="Builtin" map-to="def:builtin"/>
  <style id="string" name="String" map-to="def:string"/>
  <style id="attribute" name="Attribute" map-to="xml:attribute-name"/>
  <style id="note" name="Note" map-to="def:note"/>
  <style id="operator" name="Operator" map-to="def:operator"/>
  <style id="identifier" name="Attribute name" map-to="def:identifier"/>
  <style id="comment" name="Comment" map-to="def:comment"/>
  <style id="doc-comment" name="Comment" map-to="def:doc-comment"/>
  <style id="error" name="Error" map-to="def:error"/>
  <style id="state-machine" name="State machine" map-to="t2t:italic"/>
</styles>

<!-- Nothing is case-sensitive -->
<default-regex-options case-sensitive="false"/>

<definitions>
  <context id="spice">
    <include>

  <!--  Allowed characters in naming of elements or nets
Exotic names like C$@. or G?\ do work in testing, but they may not be recommended. Almost any non-word character works except {} or () or ' (interpreted as a replacement for { or }) or = (it is allowed but not followed by any other character, or in net names) or , or space -->
      <define-regex id="chars">[^\s{}(),;'=]+</define-regex>

  <!--  Commented line
Starts at line start with [*#$] and goes until EOL, can have spaces before -->
      <context id="commented-line" style-ref="comment">
        <start>^\s*[*#$;]</start>
        <end>$</end>
        <include>
          <context id="comment-exceptions" style-ref="attribute" extend-parent="false">
            <match>[|+\[\]&gt;&lt;\\/]</match>
          </context>
        </include>
      </context>

  <!--  In-line comment
Starts from character ; until EOL. There are exceptions in netlist elements where, even if it is interpreted as an in-line comment, the engine will give errors due to the syntax malforming -->
      <context id="inline-comment" style-ref="comment">
        <start>\;</start>
        <end>$</end>
      </context>

  <!--  Concatenated line
Active if the line starts with + (with or without spaces before). It differs from LTspice in that it keeps the rest of the line with the same colour as the parent line (normal), but italic, while signaling the break with a red + sign -->
      <context id="concat-line" style-ref="doc-comment">
        <start>^\s*(?=\+)</start>
        <end>$</end>
        <include>
          <context id="concat" style-ref="note">
            <match>([^\s&gt;&lt;&amp;;,=/+\-*\^]?)^\s*\+</match>
          </context>
          <context id="concat-values" style-ref="string">
            <match extended="true">
              (\s[^\s&gt;&lt;&amp;(){};,=/+\-*\^]+|
              (?![({])\s*[^\s&gt;&lt;&amp;(){};,=/+\-*\^]+)
              (?=(\s*\=(?!(\s*\=))))
            </match>
          </context>
          <context id="concat-inline-comment" style-ref="comment">
            <match>\;.*</match>
          </context>
          <context id="A-devices" style-ref="identifier">
            <match>\b(and|buf|counter|dflop|inv|modulator|xor|or|phasedet|samplehold|schmitbuf|schmitinv|schmitt|srflop|varistor|ota)\b</match>
          </context>
          <context id="subckt-params-concat" style-ref="builtin">
            <match>params\:</match>
          </context>
        </include>
      </context>


<!-- Errors first
Anything not starting with [A-Z] and having any of {}();'=, in the name is wrong -->
      <context id="id-error" style-ref="error">
        <match>^\s*[a-jl-z^0-9_\W]\S*([{}();'=,])</match>
      </context>

  <!--  Elements
All elements start with [A-Z] and can have any allowed character afterwards, including none -->
      <context id="devices" style-ref="statement">
        <start>^\s*[a-jl-z]\S*</start>
        <end>\s</end>
      </context>

  <!--  A-devices model names
Useful to be highlighted since all share the same syntax of <ID net1 net2 ... net8 model parameters/attributes> and there is a small variety of them available-->
      <context id="A-models" style-ref="identifier">
        <prefix>((^\+\S*)?)\s</prefix>
        <suffix>\b(?!(\s*[=&lt;&gt;(*\-+/]))</suffix>
        <keyword>and</keyword>
        <keyword>buf</keyword>
        <keyword>counter</keyword>
        <keyword>dflop</keyword>
        <keyword>inv</keyword>
        <keyword>modulator</keyword>
        <keyword>xor</keyword>
        <keyword>or</keyword>
        <keyword>ota</keyword>
        <keyword>phasedet</keyword>
        <keyword>samplehold</keyword>
        <keyword>schmitbuf</keyword>
        <keyword>schmitinv</keyword>
        <keyword>schmitt</keyword>
        <keyword>srflop</keyword>
        <keyword>varistor</keyword>
      </context>

<!-- Old-style elements (E,G) attributes -->
      <context id="old-attributes" style-ref="function">
        <prefix>\b</prefix>
        <suffix>\b</suffix>
        <keyword>value(?=(\s*[={]))</keyword>
        <keyword>poly</keyword>
        <keyword>laplace(?=(\s*[=({]))(?!(\s*\=))</keyword>
        <keyword>freq(?=(\s*\{))</keyword>
        <keyword>(?!(\=\s*))table</keyword>
      </context>


  <!-- Dot-commands and coupling coefficient k-->

<!-- Parameters, functions -->
      <context id="parameters" style-ref="builtin">
        <prefix>^\s*([,.]|\.\.)</prefix>
        <suffix>\b</suffix>
        <keyword>funcs</keyword>
        <keyword>func</keyword>
        <keyword>params</keyword>
        <keyword>param</keyword>
        <keyword>parma</keyword>
        <keyword>text</keyword>
      </context>

<!-- Coupling coefficient k -->
      <context id="coupling" style-ref="builtin">
        <prefix>^\s*</prefix>
        <suffix>[a-z0-9_]*\b</suffix>
        <keyword>k</keyword>
      </context>

<!-- Parameters within .subckt, on the same line, with colon -->
      <context id="subckt-params" style-ref="builtin">
        <prefix>\s</prefix>
        <suffix>[:]</suffix>
        <keyword>params</keyword>
      </context>

<!-- Directives -->
      <context id="directives" style-ref="operator">
        <prefix>^[,.]</prefix>
        <suffix>\b</suffix>
        <keyword>nodealias</keyword>
        <keyword>nodeset</keyword>
        <keyword>meas</keyword>
        <keyword>options</keyword>
        <keyword>option</keyword>
        <keyword>opts</keyword>
        <keyword>opt</keyword>
        <keyword>ic</keyword>
        <keyword>step</keyword>
        <keyword>lib</keyword>
        <keyword>include</keyword>
        <keyword>inc</keyword>
        <keyword>backanno</keyword>
        <keyword>savebias</keyword>
        <keyword>save</keyword>
        <keyword>loadbias</keyword>
        <keyword>load</keyword>
        <keyword>global</keyword>
        <keyword>temp</keyword>
        <keyword>ferret</keyword>
        <keyword>wave</keyword>
            <!-- State-machine begin/end keywords are treated the same as directives -->
        <keyword>mach</keyword>
        <keyword>machine</keyword>
        <keyword>endmach</keyword>
        <keyword>endmachine</keyword>
      </context>

<!-- State-machine commands are still blue, but normal and italic, for distinction from directives -->
      <context id="state-machine" style-ref="state-machine">
        <prefix>^[,.]</prefix>
        <suffix>\b</suffix>
        <keyword>state</keyword>
        <keyword>rule</keyword>
        <keyword>output</keyword>
      </context>

<!-- Simulation cards -->
      <context id="simulation" style-ref="builtin">
        <prefix>^[,.]</prefix>
        <suffix>\b</suffix>
        <keyword>four</keyword>
        <keyword>dc</keyword>
        <keyword>ac</keyword>
        <keyword>tran</keyword>
        <keyword>op</keyword>
        <keyword>tf</keyword>
        <keyword>net</keyword>
      </context>

      <context id="subckt-model" style-ref="preprocessor">
        <start extended="true">
          ^[,.] ( end\b | (ends|subckt|model)\s+(?=(\%{chars})) )
        </start>
        <end>$|\s</end>
        <include>
          <context id="subckt-name" style-ref="note">
            <match>((ends|model|subckt)\s+)?\%{chars}(?=($|\s*?))</match>
          </context>
        </include>
      </context>

<!-- Simulation cards -->
      <context id="end-subckt" style-ref="preprocessor">
        <prefix>^[,.]</prefix>
        <suffix>\b</suffix>
        <keyword>ends</keyword>
      </context>

      <context id="variables" style-ref="string">
        <match extended="true">
        (\s[^\s&gt;&lt;&amp;(){};,=/+\-*\^]+|
        (?![({])\s*[^\s&gt;&lt;&amp;(){};,=/+\-*\^]+)
        (?=(\s*\=(?!(\s*\=))))
        </match>
      </context>

<!-- Functions highlighted without the parenthesis -->
      <context id="funcs" style-ref="string">
        <match extended="true">
        ((^\s*[.](funcs|func))?)
        \s+[^\s&gt;&lt;&amp;(){};,=/+\-*\^]+\s*(?=(\([^()]*\))\s+(\{))
        </match>
      </context>

    </include>
  </context>
</definitions>

</language>

Filemanager

Name Type Size Permission Actions
R.lang File 77.54 KB 0644
abnf.lang File 3.54 KB 0644
actionscript.lang File 8.64 KB 0644
ada.lang File 7.05 KB 0644
ansforth94.lang File 22.6 KB 0644
asciidoc.lang File 22.17 KB 0644
asp.lang File 40.88 KB 0644
automake.lang File 11.21 KB 0644
awk.lang File 4.34 KB 0644
bennugd.lang File 8.81 KB 0644
bibtex.lang File 3.75 KB 0644
blueprint.lang File 11.57 KB 0644
bluespec.lang File 5.79 KB 0644
boo.lang File 8.42 KB 0644
c.lang File 13.18 KB 0644
cg.lang File 10.05 KB 0644
changelog.lang File 3.41 KB 0644
chdr.lang File 1.85 KB 0644
cmake.lang File 57.69 KB 0644
cobol.lang File 20.8 KB 0644
commonlisp.lang File 17.14 KB 0644
cpp.lang File 5.06 KB 0644
cpphdr.lang File 1.49 KB 0644
csharp.lang File 9.46 KB 0644
css.lang File 89.19 KB 0644
csv.lang File 2.42 KB 0644
cuda.lang File 10.22 KB 0644
d.lang File 9.83 KB 0644
dart.lang File 9.52 KB 0644
def.lang File 13.78 KB 0644
desktop.lang File 10.76 KB 0644
diff.lang File 2.99 KB 0644
docbook.lang File 15.98 KB 0644
docker.lang File 5.61 KB 0644
dosbatch.lang File 5.08 KB 0644
dot.lang File 4.42 KB 0644
dpatch.lang File 1.49 KB 0644
dtd.lang File 4.52 KB 0644
dtl.lang File 9.9 KB 0644
eiffel.lang File 7.11 KB 0644
erb-html.lang File 1.28 KB 0644
erb-js.lang File 1.26 KB 0644
erb.lang File 2.21 KB 0644
erlang.lang File 8.26 KB 0644
fcl.lang File 3.75 KB 0644
fish.lang File 15.67 KB 0644
forth.lang File 9.34 KB 0644
fortran.lang File 22.95 KB 0644
fsharp.lang File 10.79 KB 0644
ftl.lang File 3.06 KB 0644
gap.lang File 2.72 KB 0644
gdb-log.lang File 6.81 KB 0644
gdscript.lang File 9.94 KB 0644
genie.lang File 7.62 KB 0644
glsl.lang File 17.33 KB 0644
go.lang File 10.39 KB 0644
gradle.lang File 1.69 KB 0644
groovy.lang File 11.94 KB 0644
gtk-doc.lang File 3.66 KB 0644
gtkrc.lang File 4.12 KB 0644
haddock.lang File 5.92 KB 0644
haskell-literate.lang File 1.73 KB 0644
haskell.lang File 8.2 KB 0644
haxe.lang File 7.71 KB 0644
html.lang File 12.29 KB 0644
idl-exelis.lang File 20.63 KB 0644
idl.lang File 5.06 KB 0644
imagej.lang File 29.42 KB 0644
ini.lang File 3.5 KB 0644
j.lang File 7.45 KB 0644
jade.lang File 6.53 KB 0644
java.lang File 9.03 KB 0644
javascript-expressions.lang File 31.33 KB 0644
javascript-functions-classes.lang File 17.44 KB 0644
javascript-literals.lang File 21.88 KB 0644
javascript-modules.lang File 13.47 KB 0644
javascript-statements.lang File 29 KB 0644
javascript-values.lang File 30.42 KB 0644
javascript.lang File 39.58 KB 0644
jsdoc.lang File 7.65 KB 0644
json.lang File 4.28 KB 0644
jsx.lang File 13.85 KB 0644
julia.lang File 14.03 KB 0644
kotlin.lang File 13.19 KB 0644
language.dtd File 2.29 KB 0644
language.rng File 10.78 KB 0644
language2.rng File 12.93 KB 0644
latex.lang File 24.88 KB 0644
lean.lang File 5.56 KB 0644
less.lang File 30.97 KB 0644
lex.lang File 6.19 KB 0644
libtool.lang File 1.83 KB 0644
llvm.lang File 10.08 KB 0644
logcat.lang File 3.35 KB 0644
logtalk.lang File 14.22 KB 0644
lua.lang File 10.25 KB 0644
m4.lang File 45.08 KB 0644
makefile.lang File 6.09 KB 0644
mallard.lang File 3.69 KB 0644
markdown.lang File 15.22 KB 0644
matlab.lang File 4.87 KB 0644
maxima.lang File 65.65 KB 0644
mediawiki.lang File 10.68 KB 0644
meson.lang File 5.78 KB 0644
modelica.lang File 9.26 KB 0644
mxml.lang File 2.16 KB 0644
nemerle.lang File 8.21 KB 0644
netrexx.lang File 10.36 KB 0644
nix.lang File 6.08 KB 0644
nsis.lang File 2.65 KB 0644
objc.lang File 4.05 KB 0644
objj.lang File 20.88 KB 0644
ocaml.lang File 12.25 KB 0644
ocl.lang File 5.24 KB 0644
octave.lang File 59.04 KB 0644
ooc.lang File 8.51 KB 0644
opal.lang File 10.98 KB 0644
opencl.lang File 20.36 KB 0644
pascal.lang File 8.28 KB 0644
perl.lang File 36.64 KB 0644
php.lang File 13.26 KB 0644
pig.lang File 9.35 KB 0644
pkgconfig.lang File 1.98 KB 0644
po.lang File 3.33 KB 0644
powershell.lang File 26.96 KB 0644
prolog.lang File 8.2 KB 0644
protobuf.lang File 4.4 KB 0644
puppet.lang File 23.72 KB 0644
python.lang File 17.05 KB 0644
python3.lang File 14.43 KB 0644
reasonml.lang File 10.06 KB 0644
rpmspec.lang File 7.56 KB 0644
rst.lang File 7.56 KB 0644
ruby.lang File 26.96 KB 0644
rust.lang File 10.35 KB 0644
scala.lang File 12.63 KB 0644
scheme.lang File 10.17 KB 0644
scilab.lang File 6.87 KB 0644
scss.lang File 33.28 KB 0644
sh.lang File 37.31 KB 0644
sml.lang File 6.43 KB 0644
solidity.lang File 10.87 KB 0644
sparql.lang File 16.34 KB 0644
spice.lang File 13.07 KB 0644
sql.lang File 24.76 KB 0644
star.lang File 3.57 KB 0644
sweave.lang File 2.18 KB 0644
swift.lang File 16.26 KB 0644
systemverilog.lang File 8.6 KB 0644
t2t.lang File 5.21 KB 0644
tcl.lang File 4.46 KB 0644
tera.lang File 5.12 KB 0644
terraform.lang File 15.23 KB 0644
texinfo.lang File 15.23 KB 0644
thrift.lang File 8.45 KB 0644
todotxt.lang File 2.87 KB 0644
toml.lang File 8.46 KB 0644
twig.lang File 11.31 KB 0644
typescript-js-expressions.lang File 7.53 KB 0644
typescript-js-functions-classes.lang File 23.45 KB 0644
typescript-js-literals.lang File 5.07 KB 0644
typescript-js-modules.lang File 9.97 KB 0644
typescript-js-statements.lang File 17.84 KB 0644
typescript-jsx.lang File 6.55 KB 0644
typescript-type-expressions.lang File 19.42 KB 0644
typescript-type-generics.lang File 8.59 KB 0644
typescript-type-literals.lang File 13.86 KB 0644
typescript.lang File 38.67 KB 0644
vala.lang File 13.1 KB 0644
vbnet.lang File 7.78 KB 0644
verilog.lang File 15.54 KB 0644
vhdl.lang File 7.68 KB 0644
xml.lang File 9.23 KB 0644
xslt.lang File 3.83 KB 0644
yacc.lang File 5.7 KB 0644
yaml.lang File 8.76 KB 0644
yara.lang File 6.37 KB 0644