<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML><HEAD><TITLE>The BASH Parser</TITLE><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Cuiterm Reference Manual" HREF="index.html"><LINK REL="UP" TITLE="Cuiterm Documentation 0.5" HREF="c4.html"><LINK REL="PREVIOUS" TITLE="CuiGenerator" HREF="cuigenerator.html"><LINK REL="NEXT" TITLE="Drag and Drop" HREF="cuiterm-drag-and-drop.html"><META NAME="GENERATOR" CONTENT="GTK-Doc V1.3 (SGML mode)"><STYLE TYPE="text/css">.synopsis, .classsynopsis { background: #eeeeee; border: solid 1px #aaaaaa; padding: 0.5em; } .programlisting { background: #eeeeff; border: solid 1px #aaaaff; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .navigation { background: #ffeeee; border: solid 1px #ffaaaa; margin-top: 0.5em; margin-bottom: 0.5em; } .navigation a { color: #770000; } .navigation a:visited { color: #550000; } .navigation .title { font-size: 200%; }</STYLE></HEAD><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF"><TABLE WIDTH="100%" CLASS="navigation" SUMMARY="Navigation header" CELLPADDING="2" CELLSPACING="2"><TR VALIGN="middle"><TD><A ACCESSKEY="p" HREF="cuigenerator.html"><IMG SRC="left.png" WIDTH="24" HEIGHT="24" BORDER="0" ALT="Prev"></A></TD><TD><A ACCESSKEY="u" HREF="c4.html"><IMG SRC="up.png" WIDTH="24" HEIGHT="24" BORDER="0" ALT="Up"></A></TD><TD><A ACCESSKEY="h" HREF="index.html"><IMG SRC="home.png" WIDTH="24" HEIGHT="24" BORDER="0" ALT="Home"></A></TD><TH WIDTH="100%" align="center">Cuiterm Reference Manual</TH><TD><A ACCESSKEY="n" HREF="cuiterm-drag-and-drop.html"><IMG SRC="right.png" WIDTH="24" HEIGHT="24" BORDER="0" ALT="Next"></A></TD></TR></TABLE><H1><A NAME="CUITERM-BASH-PARSER"></A>The BASH Parser</H1><DIV CLASS="REFNAMEDIV"><A NAME="AEN7622"></A><H2>Name</H2>The BASH Parser -- A flex/bison parser for BASH commands.</DIV><DIV CLASS="REFSYNOPSISDIV"><A NAME="AEN7625"></A><H2>Synopsis</H2><PRE CLASS="SYNOPSIS"> #include <history.h> gboolean <A HREF="cuiterm-bash-parser.html#PARSE-TREE-CHECK-OPTION">parse_tree_check_option</A> (GNode *node, const gchar *program, const gchar *option); gchar* <A HREF="cuiterm-bash-parser.html#PARSE-TREE-GET-PRODUCER-PROGRAM">parse_tree_get_producer_program</A> (GNode *tree);</PRE></DIV><DIV CLASS="REFSECT1"><A NAME="AEN7636"></A><H2>Description</H2><P>The BASH Parser creates a parse tree of the BASH expressions. This parse tree will be used to decide which command parser to use and how to interpret the lines the program prints.</P></DIV><DIV CLASS="REFSECT1"><A NAME="AEN7639"></A><H2>Details</H2><DIV CLASS="REFSECT2"><A NAME="AEN7641"></A><H3><A NAME="PARSE-TREE-CHECK-OPTION"></A>parse_tree_check_option ()</H3><PRE CLASS="PROGRAMLISTING">gboolean parse_tree_check_option (GNode *node, const gchar *program, const gchar *option);</PRE><P>Check if the given program has the option by the parse tree. This function checks only the leftmost instance of the command.</P><P></P><P></P><TABLE CLASS="variablelist" BORDER="0" CELLSPACING="0" CELLPADDING="4"><TBODY><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7654"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">node</CODE> :</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the root node of the parse tree</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7659"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">program</CODE> :</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the name of the program</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7664"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">option</CODE> :</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the short or long option</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7669"><SPAN STYLE="white-space: nowrap"><SPAN CLASS="emphasis"><I CLASS="EMPHASIS">Returns</I></SPAN> :</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> TRUE if the option was used</P></TD></TR></TBODY></TABLE></DIV><HR><DIV CLASS="REFSECT2"><A NAME="AEN7674"></A><H3><A NAME="PARSE-TREE-GET-PRODUCER-PROGRAM"></A>parse_tree_get_producer_program ()</H3><PRE CLASS="PROGRAMLISTING">gchar* parse_tree_get_producer_program (GNode *tree);</PRE><P></P><P></P><TABLE CLASS="variablelist" BORDER="0" CELLSPACING="0" CELLPADDING="4"><TBODY><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7684"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">tree</CODE> :</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7689"><SPAN STYLE="white-space: nowrap"><SPAN CLASS="emphasis"><I CLASS="EMPHASIS">Returns</I></SPAN> :</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> </P></TD></TR></TBODY></TABLE></DIV></DIV><TABLE CLASS="navigation" WIDTH="100%" SUMMARY="Navigation footer" CELLPADDING="2" CELLSPACING="2"><TR VALIGN="middle"><TD ALIGN="left"><A ACCESSKEY="p" HREF="cuigenerator.html"><B><<< CuiGenerator</B></A></TD><TD ALIGN="right"><A ACCESSKEY="n" HREF="cuiterm-drag-and-drop.html"><B>Drag and Drop >>></B></A></TD></TR></TABLE></BODY></HTML>