<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://gnucap.org/dokuwiki/lib/exe/css.php?s=feed" type="text/css"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
    <title>* gnucap:manual:tech:plugins:languages</title>
    <tagline></tagline>
    <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/"/>
    <id>http://gnucap.org/dokuwiki/</id>
    <modified>2026-04-10T07:04:38-05:00</modified>
    <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:args</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:args?rev=1372357804&amp;do=diff"/>
        <created>2013-06-27T13:30:04-05:00</created>
        <issued>2013-06-27T13:30:04-05:00</issued>
        <modified>2013-06-27T13:30:04-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:args?rev=1372357804&amp;do=diff</id>
        <summary>parse, print args

Background

“Args” are the parameters of the device.

Some languages read in args by order, some by name, some either way.  

When reading by order, the meaning is determined by the order in the list.  A single value, such as resistance of a resistor, specified as just a number, is a simple case of reading by order.  There is also a special case that allows you to identify one as the “value” and read the rest by name.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:attributes</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:attributes?rev=1698981445&amp;do=diff"/>
        <created>2023-11-02T22:17:25-05:00</created>
        <issued>2023-11-02T22:17:25-05:00</issued>
        <modified>2023-11-02T22:17:25-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:attributes?rev=1698981445&amp;do=diff</id>
        <summary>Attributes

Background

Sometimes it is desired to attach some meta-data, an “attribute” to some object.  The name and the use of such attributes is determined externally by some other application.  It has meaning there, but likely not to us.  We just need to store it, to pass it on as we get it, unchanged.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:command</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:command?rev=1403842555&amp;do=diff"/>
        <created>2014-06-26T23:15:55-05:00</created>
        <issued>2014-06-26T23:15:55-05:00</issued>
        <modified>2014-06-26T23:15:55-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:command?rev=1403842555&amp;do=diff</id>
        <summary>parse, print command

Background

A command object executes a command, does not store anything.  The reference to “dot” and “dotcard” is historical, because in Spice, commands were prefixed by a dot.

This section may change as scripting is enhanced.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:comment</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:comment?rev=1378515171&amp;do=diff"/>
        <created>2013-09-06T19:52:51-05:00</created>
        <issued>2013-09-06T19:52:51-05:00</issued>
        <modified>2013-09-06T19:52:51-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:comment?rev=1378515171&amp;do=diff</id>
        <summary>parse, print comment

Background

A comment object stores a string, otherwise does nothing.

For reference, here is the class definition from d_coment.h .


/*--------------------------------------------------------------------------*/
class DEV_COMMENT : public CARD {
private:
  std::string	_s;
  explicit	DEV_COMMENT(const DEV_COMMENT&amp; p)
				:CARD(p) {set_constant(true);}
public:
  explicit	DEV_COMMENT()	:CARD()  {set_constant(true);}
private: // override virtual
  char		id_letter()const	{retu…</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:find_type_in_string</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:find_type_in_string?rev=1372356570&amp;do=diff"/>
        <created>2013-06-27T13:09:30-05:00</created>
        <issued>2013-06-27T13:09:30-05:00</issued>
        <modified>2013-06-27T13:09:30-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:find_type_in_string?rev=1372356570&amp;do=diff</id>
        <summary>find_type_in_string

This function scans an input string and extracts the “type” from it.  In some cases the type is explicitly stated and easy to find.  In others finding the type can be tricky.  In any case, scanning is reset to the beginning after the type is found.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:instance</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:instance?rev=1372356934&amp;do=diff"/>
        <created>2013-06-27T13:15:34-05:00</created>
        <issued>2013-06-27T13:15:34-05:00</issued>
        <modified>2013-06-27T13:15:34-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:instance?rev=1372356934&amp;do=diff</id>
        <summary>parse, print instance, paramset

Background

A netlist is primarily a list of instances.

Synonyms for instance include component, device, element.

Examples of instances include resistors, transistors.

A paramset is a prototype for an instance.  Internally, it is the same except that a paramset has no ports, but most languages have a different syntax for it.  The word “paramset” is from Verilog syntax.  In Spice, this would be a “model” statement.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:label</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:label?rev=1372357466&amp;do=diff"/>
        <created>2013-06-27T13:24:26-05:00</created>
        <issued>2013-06-27T13:24:26-05:00</issued>
        <modified>2013-06-27T13:24:26-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:label?rev=1372357466&amp;do=diff</id>
        <summary>parse, print label

Background

The label is a string by which this instance is known.

In a paramset (Spice .model) the label is the name of the new type being defined.

A “short_label” is the simple form of the label, without scope information.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:lang_base.h</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:lang_base.h?rev=1372355532&amp;do=diff"/>
        <created>2013-06-27T12:52:12-05:00</created>
        <issued>2013-06-27T12:52:12-05:00</issued>
        <modified>2013-06-27T12:52:12-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:lang_base.h?rev=1372355532&amp;do=diff</id>
        <summary>lang_base.h

If your version of gnucap does not supply lang_base.h, use this one, copy it to the place where the gnucap headers are.


#include &quot;globals.h&quot;
#include &quot;c_comand.h&quot;
#include &quot;d_dot.h&quot;
#include &quot;d_coment.h&quot;
#include &quot;d_subckt.h&quot;
#include &quot;e_model.h&quot;
#include &quot;u_lang.h&quot;</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:module</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:module?rev=1372357015&amp;do=diff"/>
        <created>2013-06-27T13:16:55-05:00</created>
        <issued>2013-06-27T13:16:55-05:00</issued>
        <modified>2013-06-27T13:16:55-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:module?rev=1372357015&amp;do=diff</id>
        <summary>parse, print module

Background

A module is container of instances.  To a compiler, a module can also contain code to be executed, but gnucap does not directly support that.

A Spice “subckt” is a module.

	*  type -- A module defines a new type.
	*  label -- The label is the name of the new type.
	*  ports -- This is the list of connections.
	*  args -- The arg list is optional.  If left out, the arg list is open.  It accepts whatever it is fed.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:parse_top_item</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:parse_top_item?rev=1372356522&amp;do=diff"/>
        <created>2013-06-27T13:08:42-05:00</created>
        <issued>2013-06-27T13:08:42-05:00</issued>
        <modified>2013-06-27T13:08:42-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:parse_top_item?rev=1372356522&amp;do=diff</id>
        <summary>parse_top_item

The function parse_top_item must be provided.  Usually you can just copy this.


/*--------------------------------------------------------------------------*/
void LANG_VERILOG::parse_top_item(CS&amp; cmd, CARD_LIST* Scope)
{
  cmd.get_line(&quot;gnucap-verilog&gt;&quot;);
  new__instance(cmd, NULL, Scope);
}
/*--------------------------------------------------------------------------*/</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:ports</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:ports?rev=1372357557&amp;do=diff"/>
        <created>2013-06-27T13:25:57-05:00</created>
        <issued>2013-06-27T13:25:57-05:00</issued>
        <modified>2013-06-27T13:25:57-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:ports?rev=1372357557&amp;do=diff</id>
        <summary>parse, print ports

Background

Ports are the connections, how this particular instance is connected to the rest of the circuit.

Paramsets do not have ports.

In most languages, ports are nodes.  “Through” ports such as currents are rarely supported.  Nodes and through ports are stored in separate lists.  As of when this is being written, only the Spice format supports through ports in any way, and even this is limited to just a few devices.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:simple_query_functions</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:simple_query_functions?rev=1372356407&amp;do=diff"/>
        <created>2013-06-27T13:06:47-05:00</created>
        <issued>2013-06-27T13:06:47-05:00</issued>
        <modified>2013-06-27T13:06:47-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:simple_query_functions?rev=1372356407&amp;do=diff</id>
        <summary>Simple query functions

~LANGUAGE()

C++ rules require a virtual destructor when there are virtual functions.  You need to define one as a tracing aid.  It can be an empty function.


  ~LANG_VERILOG() {itested();}


std::string name()const

Return the name to use as a key to enable this language.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:top_level</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:top_level?rev=1372355484&amp;do=diff"/>
        <created>2013-06-27T12:51:24-05:00</created>
        <issued>2013-06-27T12:51:24-05:00</issued>
        <modified>2013-06-27T12:51:24-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:top_level?rev=1372355484&amp;do=diff</id>
        <summary>Top Level

At top level, you need to include the header file.


#include &quot;gnucap/lang_base.h&quot;


If you want to be able to static link the plugin, or combine it with others, wrap it in an anonymous namespace.


namespace {
/*--------------------------------------------------------------------------*/
// all of your other code goes here
/*--------------------------------------------------------------------------*/
} // close the anonymous namespace
/*-----------------------------------------------…</summary>
    </entry>
    <entry>
        <title>gnucap:manual:tech:plugins:languages:type</title>
        <link rel="alternate" type="text/html" href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:type?rev=1449869995&amp;do=diff"/>
        <created>2015-12-11T15:39:55-05:00</created>
        <issued>2015-12-11T15:39:55-05:00</issued>
        <modified>2015-12-11T15:39:55-05:00</modified>
        <id>http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:plugins:languages:type?rev=1449869995&amp;do=diff</id>
        <summary>Implementation

parse, print instance, paramset

parse, print type

Background

It may seem redundant to parse the type again, because the type is already known.  It was determined by find_type_in_string, then the type was looked up, and a new instance of that type was created.</summary>
    </entry>
</feed>
