text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkInfoBar</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="DisplayWidgets.html" title="Display Widgets">
<link rel="prev" href="GtkStatusbar.html" title="GtkStatusbar">
<link rel="next" href="GtkStatusIcon.html" title="GtkStatusIcon">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">

GTK+ Reference Manual

Top
                   |
                  Description
                   |
                  Object Hierarchy
                   |
                  Implemented Interfaces
                   |
                  Properties
                   |
                  Style Properties
                   |
                  Signals

GtkInfoBar

GtkInfoBar — Report important messages to the user

Synopsis

#include <gtk/gtk.h>

                    GtkInfoBar;
GtkWidget *         gtk_info_bar_new                    (void);
GtkWidget *         gtk_info_bar_new_with_buttons       (const gchar *first_button_text,
                                                         ...);
void                gtk_info_bar_add_action_widget      (GtkInfoBar *info_bar,
                                                         GtkWidget *child,
                                                         gint response_id);
GtkWidget *         gtk_info_bar_add_button             (GtkInfoBar *info_bar,
                                                         const gchar *button_text,
                                                         gint response_id);
void                gtk_info_bar_add_buttons            (GtkInfoBar *info_bar,
                                                         const gchar *first_button_text,
                                                         ...);
void                gtk_info_bar_set_response_sensitive (GtkInfoBar *info_bar,
                                                         gint response_id,
                                                         gboolean setting);
void                gtk_info_bar_set_default_response   (GtkInfoBar *info_bar,
                                                         gint response_id);
void                gtk_info_bar_response               (GtkInfoBar *info_bar,
                                                         gint response_id);
void                gtk_info_bar_set_message_type       (GtkInfoBar *info_bar,
                                                         GtkMessageType message_type);
GtkMessageType      gtk_info_bar_get_message_type       (GtkInfoBar *info_bar);
GtkWidget *         gtk_info_bar_get_action_area        (GtkInfoBar *info_bar);
GtkWidget *         gtk_info_bar_get_content_area       (GtkInfoBar *info_bar);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBox
                                 +----GtkHBox
                                       +----GtkInfoBar

Implemented Interfaces

GtkInfoBar implements
 AtkImplementorIface,  GtkBuildable and  GtkOrientable.

Properties

  "message-type"             GtkMessageType        : Read / Write / Construct

Style Properties

  "action-area-border"       gint                  : Read
  "button-spacing"           gint                  : Read
  "content-area-border"      gint                  : Read
  "content-area-spacing"     gint                  : Read

Signals

  "close"                                          : Run Last / Action
  "response"                                       : Run Last

Description

GtkInfoBar is a widget that can be used to show messages to
the user without showing a dialog. It is often temporarily shown
at the top or bottom of a document. In contrast to GtkDialog, which
has a horizontal action area at the bottom, GtkInfoBar has a
vertical action area at the side.

The API of GtkInfoBar is very similar to GtkDialog, allowing you
to add buttons to the action area with gtk_info_bar_add_button() or
gtk_info_bar_new_with_buttons(). The sensitivity of action widgets
can be controlled with gtk_info_bar_set_response_sensitive().
To add widgets to the main content area of a GtkInfoBar, use
gtk_info_bar_get_content_area() and add your widgets to the container.

Similar to GtkMessageDialog, the contents of a GtkInfoBar can by
classified as error message, warning, informational message, etc,
by using gtk_info_bar_set_message_type(). GTK+ uses the message type
to determine the background color of the message area.

Example 14. Simple GtkInfoBar usage.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

/* set up info bar */
info_bar = gtk_info_bar_new ();
gtk_widget_set_no_show_all (info_bar, TRUE);
message_label = gtk_label_new ("");
gtk_widget_show (message_label);
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar));
gtk_container_add (GTK_CONTAINER (content_area), message_label);
gtk_info_bar_add_button (GTK_INFO_BAR (info_bar),
                         GTK_STOCK_OK, GTK_RESPONSE_OK);
g_signal_connect (info_bar, "response",
                  G_CALLBACK (gtk_widget_hide), NULL);
gtk_table_attach (GTK_TABLE (table),
                  info_bar,
                  0, 1, 2, 3,
                  GTK_EXPAND | GTK_FILL,  0,
                  0,                      0);

/* ... */

/* show an error message */
gtk_label_set_text (GTK_LABEL (message_label), error_message);
gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar),
                               GTK_MESSAGE_ERROR);
gtk_widget_show (info_bar);

GtkInfoBar as GtkBuildable

The GtkInfoBar implementation of the GtkBuildable interface exposes
the content area and action area as internal children with the names
"content_area" and "action_area".

GtkInfoBar supports a custom <action-widgets> element, which
can contain multiple <action-widget> elements. The "response"
attribute specifies a numeric response, and the content of the element
is the id of widget (which should be a child of the dialogs action_area).

Details

GtkInfoBar

typedef struct _GtkInfoBar GtkInfoBar;

gtk_info_bar_new ()

GtkWidget *         gtk_info_bar_new                    (void);

Creates a new GtkInfoBar object.

<col align="left" valign="top">

Returns :

 a new GtkInfoBar object

Since 2.18

gtk_info_bar_new_with_buttons ()

GtkWidget *         gtk_info_bar_new_with_buttons       (const gchar *first_button_text,
                                                         ...);

Creates a new GtkInfoBar with buttons. Button text/response ID
pairs should be listed, with a NULL pointer ending the list.
Button text can be either a stock ID such as GTK_STOCK_OK, or
some arbitrary text. A response ID can be any positive number,
or one of the values in the GtkResponseType enumeration. If the
user clicks one of these dialog buttons, GtkInfoBar will emit
the "response" signal with the corresponding response ID.

<col align="left" valign="top">

first_button_text :

 stock ID or text to go in first button, or NULL. [<acronym title="NULL is ok, both for passing and for returning.">allow-none</acronym>]

... :

response ID for first button, then additional buttons, ending
   with NULL

Returns :

 a new GtkInfoBar

gtk_info_bar_add_action_widget ()

void                gtk_info_bar_add_action_widget      (GtkInfoBar *info_bar,
                                                         GtkWidget *child,
                                                         gint response_id);

Add an activatable widget to the action area of a GtkInfoBar,
connecting a signal handler that will emit the "response"
signal on the message area when the widget is activated. The widget
is appended to the end of the message areas action area.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

child :

an activatable widget

response_id :

response ID for child

Since 2.18

gtk_info_bar_add_button ()

GtkWidget *         gtk_info_bar_add_button             (GtkInfoBar *info_bar,
                                                         const gchar *button_text,
                                                         gint response_id);

Adds a button with the given text (or a stock button, if button_text
is a stock ID) and sets things up so that clicking the button will emit
the "response" signal with the given response_id. The button is appended
to the end of the info bars's action area. The button widget is
returned, but usually you don't need it.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

button_text :

text of button, or stock ID

response_id :

response ID for the button

Returns :

 the button widget that was added

Since 2.18

gtk_info_bar_add_buttons ()

void                gtk_info_bar_add_buttons            (GtkInfoBar *info_bar,
                                                         const gchar *first_button_text,
                                                         ...);

Adds more buttons, same as calling gtk_info_bar_add_button()
repeatedly. The variable argument list should be NULL-terminated
as with gtk_info_bar_new_with_buttons(). Each button must have both
text and response ID.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

first_button_text :

button text or stock ID

... :

response ID for first button, then more text-response_id pairs,
    ending with NULL

Since 2.18

gtk_info_bar_set_response_sensitive ()

void                gtk_info_bar_set_response_sensitive (GtkInfoBar *info_bar,
                                                         gint response_id,
                                                         gboolean setting);

Calls gtk_widget_set_sensitive (widget, setting) for each
widget in the info bars's action area with the given response_id.
A convenient way to sensitize/desensitize dialog buttons.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

response_id :

a response ID

setting :

TRUE for sensitive

Since 2.18

gtk_info_bar_set_default_response ()

void                gtk_info_bar_set_default_response   (GtkInfoBar *info_bar,
                                                         gint response_id);

Sets the last widget in the info bar's action area with
the given response_id as the default widget for the dialog.
Pressing "Enter" normally activates the default widget.

Note that this function currently requires info_bar to
be added to a widget hierarchy.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

response_id :

a response ID

Since 2.18

gtk_info_bar_response ()

void                gtk_info_bar_response               (GtkInfoBar *info_bar,
                                                         gint response_id);

Emits the 'response' signal with the given response_id.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

response_id :

a response ID

Since 2.18

gtk_info_bar_set_message_type ()

void                gtk_info_bar_set_message_type       (GtkInfoBar *info_bar,
                                                         GtkMessageType message_type);

Sets the message type of the message area.
GTK+ uses this type to determine what color to use
when drawing the message area.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

message_type :

a GtkMessageType

Since 2.18

gtk_info_bar_get_message_type ()

GtkMessageType      gtk_info_bar_get_message_type       (GtkInfoBar *info_bar);

Returns the message type of the message area.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

Returns :

 the message type of the message area.

Since 2.18

gtk_info_bar_get_action_area ()

GtkWidget *         gtk_info_bar_get_action_area        (GtkInfoBar *info_bar);

Returns the action area of info_bar.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

Returns :

 the action area.

Since 2.18

gtk_info_bar_get_content_area ()

GtkWidget *         gtk_info_bar_get_content_area       (GtkInfoBar *info_bar);

Returns the content area of info_bar.

<col align="left" valign="top">

info_bar :

a GtkInfoBar

Returns :

 the content area.

Since 2.18

Property Details

The "message-type" property

  "message-type"             GtkMessageType        : Read / Write / Construct

The type of the message.

The type is used to determine the colors to use in the info bar.
The following symbolic color names can by used to customize
these colors:
"info_fg_color", "info_bg_color",
"warning_fg_color", "warning_bg_color",
"question_fg_color", "question_bg_color",
"error_fg_color", "error_bg_color".
"other_fg_color", "other_bg_color".

If the type is GTK_MESSAGE_OTHER, no info bar is painted but the
colors are still set.

Default value: GTK_MESSAGE_INFO

Since 2.18

Style Property Details

The "action-area-border" style property

  "action-area-border"       gint                  : Read

Width of the border around the action area of the info bar.

Allowed values: >= 0

Default value: 5

Since 2.18

The "button-spacing" style property

  "button-spacing"           gint                  : Read

Spacing between buttons in the action area of the info bar.

Allowed values: >= 0

Default value: 6

Since 2.18

The "content-area-border" style property

  "content-area-border"      gint                  : Read

The width of the border around the content
content area of the info bar.

Allowed values: >= 0

Default value: 8

Since 2.18

The "content-area-spacing" style property

  "content-area-spacing"     gint                  : Read

The default spacing used between elements of the
content area of the info bar.

Allowed values: >= 0

Default value: 16

Since 2.18

Signal Details

The "close" signal

void                user_function                      (GtkInfoBar *arg0,
                                                        gpointer    user_data)      : Run Last / Action

The ::close signal is a
keybinding signal
which gets emitted when the user uses a keybinding to dismiss
the info bar.

The default binding for this signal is the Escape key.

<col align="left" valign="top">

user_data :

user data set when the signal handler was connected.

Since 2.18

The "response" signal

void                user_function                      (GtkInfoBar *info_bar,
                                                        gint        response_id,
                                                        gpointer    user_data)        : Run Last

Emitted when an action widget is clicked or the application programmer
calls gtk_dialog_response(). The response_id depends on which action
widget was clicked.

<col align="left" valign="top">

info_bar :

the object on which the signal is emitted

response_id :

the response ID

user_data :

user data set when the signal handler was connected.

Since 2.18

See Also

GtkStatusbar, GtkMessageDialog

          Generated by GTK-Doc V1.15


text:
SRCDIR   := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
SRCDIRS  := $(SRCDIR)
SHELL    := /bin/bash

EXTRA_BINS += $(BUILDDIR)/$(FIRMDIR).bin

include $(SRCDIR)/../common/rpc/include.mk
include $(SRCDIR)/../common/c2c/include.mk
include $(SRCDIR)/../common/eth/include.mk
include $(SRCDIR)/../common/rnd/include.mk
include $(SRCDIR)/../common/ioeth-bsp/include.mk
include $(SRCDIR)/../Makefile

$(BUILDDIR)/$(FIRMDIR).bin: $(BUILDDIR)/$(FIRMDIR).kelf
	cp $< $<.tmp
	dd if=$(K1_TOOLCHAIN_DIR)/lib/firmware/kalray/dtb/k1b/$(lastword $(subst _, ,$(ODP_FIRMWARE_CONFIG)))/default.dtb bs=1  of=$<.tmp bs=1 seek=$$(echo "ibase=16; $$(k1-readelf --sections $< | grep .dtb | awk '{print 0x toupper($$5)}')" | bc) conv=notrunc
	k1-objcopy -Obinary $<.tmp $@

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<!--
 * Copyright (c) 2014-2015, jcabi.com
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met: 1) Redistributions of source code must retain the above
 * copyright notice, this list of conditions and the following
 * disclaimer. 2) Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following
 * disclaimer in the documentation and/or other materials provided
 * with the distribution. 3) Neither the name of the jcabi.com nor
 * the names of its contributors may be used to endorse or promote
 * products derived from this software without specific prior written
 * permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.jcabi</groupId>
        <artifactId>jcabi</artifactId>
        <version>1.18</version>
    </parent>
    <artifactId>jcabi-email</artifactId>
    <version>2.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>jcabi-email</name>
    <description>Object-Oriented Email Sending SDK</description>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/jcabi/jcabi-email/issues</url>
    </issueManagement>
    <ciManagement>
        <system>travis</system>
        <url>https://travis-ci.org/jcabi/jcabi-email</url>
    </ciManagement>
    <scm>
        <connection>scm:git:github.com:jcabi/jcabi-email.git</connection>
        <developerConnection>scm:git:github.com:jcabi/jcabi-email.git</developerConnection>
        <url>https://github.com/jcabi/jcabi-email</url>
    </scm>
    <distributionManagement>
        <site>
            <id>github-pages</id>
            <url>https://email.jcabi.com/</url>
        </site>
    </distributionManagement>
    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>com.jcabi</groupId>
            <artifactId>jcabi-aspects</artifactId>
        </dependency>
        <dependency>
            <groupId>com.jcabi</groupId>
            <artifactId>jcabi-immutable</artifactId>
        </dependency>
        <dependency>
            <groupId>com.jcabi</groupId>
            <artifactId>jcabi-log</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.5.0-b01</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mailapi</artifactId>
            <version>1.4.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>dumbster</groupId>
            <artifactId>dumbster</artifactId>
            <version>1.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>qulice</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.qulice</groupId>
                        <artifactId>qulice-maven-plugin</artifactId>
                        <configuration>
                            <license>file:${basedir}/LICENSE.txt</license>
                            <excludes>
                                <exclude>findbugs:.*</exclude>
                            </excludes>
                            <license>file:${basedir}/LICENSE.txt</license>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>


text:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import sys
import functools
from collections import namedtuple
from contextlib import contextmanager

from grako.util import notnone, ustr, prune_dict, is_list, info, safe_name
from grako.ast import AST
from grako import buffering

from grako import color

from grako.exceptions import (
    FailedCut,
    FailedLeftRecursion,
    FailedLookahead,
    FailedParse,
    FailedPattern,
    FailedSemantics,
    FailedKeywordSemantics,
    FailedToken,
    OptionSucceeded
)

__all__ = ['ParseInfo', 'ParseContext']

ParseInfo = namedtuple(
    'ParseInfo',
    [
        'buffer',
        'rule',
        'pos',
        'endpos'
    ]
)

# decorator for rule implementation methods
def graken(*params, **kwparams):
    def decorator(rule):
        @functools.wraps(rule)
        def wrapper(self):
            name = rule.__name__
            # remove the single leading and trailing underscore
            # that the parser generator added
            name = name[1:-1]
            return self._call(rule, name, params, kwparams)
        return wrapper
    return decorator

class Closure(list):
    pass

class ParseContext(object):
    def __init__(self,
                 semantics=None,
                 parseinfo=False,
                 trace=False,
                 encoding='utf-8',
                 comments_re=None,
                 eol_comments_re=None,
                 whitespace=None,
                 ignorecase=False,
                 nameguard=None,
                 memoize_lookaheads=True,
                 left_recursion=True,
                 trace_length=72,
                 trace_separator=':',
                 trace_filename=False,
                 colorize=False,
                 keywords=None,
                 namechars='',
                 **kwargs):
        super(ParseContext, self).__init__()

        self._buffer = None
        self.semantics = semantics
        self.encoding = encoding
        self.parseinfo = parseinfo
        self.trace = trace
        self.trace_length = trace_length
        self.trace_separator = trace_separator
        self.trace_filename = trace_filename

        self.comments_re = comments_re
        self.eol_comments_re = eol_comments_re
        self.whitespace = whitespace
        self.ignorecase = ignorecase
        self.nameguard = nameguard
        self.memoize_lookaheads = memoize_lookaheads
        self.left_recursion = left_recursion
        self.namechars = namechars

        self._ast_stack = [AST()]
        self._concrete_stack = [None]
        self._rule_stack = []
        self._cut_stack = [False]
        self._memoization_cache = dict()

        self._last_node = None
        self._state = None
        self._lookahead = 0

        self._recursive_results = dict()
        self._recursive_eval = []
        self._recursive_head = []

        self.colorize = colorize
        self.keywords = set(keywords or [])

    def _reset(self,
               text=None,
               filename=None,
               semantics=None,
               trace=None,
               comments_re=None,
               eol_comments_re=None,
               whitespace=None,
               ignorecase=None,
               nameguard=None,
               memoize_lookaheads=None,
               left_recursion=None,
               colorize=False,
               namechars='',
               **kwargs):
        if ignorecase is None:
            ignorecase = self.ignorecase
        if nameguard is None:
            nameguard = self.nameguard
        if memoize_lookaheads is not None:
            self.memoize_lookaheads = memoize_lookaheads
        if left_recursion is not None:
            self.left_recursion = left_recursion

        if trace is not None:
            self.trace = trace
        if semantics is not None:
            self.semantics = semantics

        if colorize is not None:
            self.colorize = colorize

        if self.colorize:
            color.init()

        if isinstance(text, buffering.Buffer):
            buffer = text
        else:
            buffer = buffering.Buffer(
                text,
                filename=filename,
                comments_re=comments_re or self.comments_re,
                eol_comments_re=eol_comments_re or self.eol_comments_re,
                whitespace=notnone(whitespace, default=self.whitespace),
                ignorecase=ignorecase,
                nameguard=nameguard,
                namechars=namechars or self.namechars,
                **kwargs)
        self._buffer = buffer
        self._ast_stack = [AST()]
        self._concrete_stack = [None]
        self._rule_stack = []
        self._cut_stack = [False]
        self._memoization_cache = dict()

        self._last_node = None
        self._state = None
        self._lookahead = 0

        self._recursive_results = dict()
        self._recursive_eval = []
        self._recursive_head = []

    def parse(self,
              text,
              rule_name='start',
              filename=None,
              semantics=None,
              trace=False,
              whitespace=None,
              **kwargs):
        try:
            self.parseinfo = kwargs.pop('parseinfo', self.parseinfo)
            self._reset(
                text=text,
                filename=filename,
                semantics=semantics,
                trace=trace or self.trace,
                whitespace=whitespace if whitespace is not None else self.whitespace,
                **kwargs
            )
            rule = self._find_rule(rule_name)
            result = rule()
            self.ast[rule_name] = result
            return result
        except FailedCut as e:
            raise e.nested
        finally:
            self._clear_cache()

    def goto(self, pos):
        self._buffer.goto(pos)

    @property
    def last_node(self):
        return self._last_node

    @last_node.setter
    def last_node(self, value):
        self._last_node = value

    @property
    def _pos(self):
        return self._buffer.pos

    def _clear_cache(self):
        self._memoization_cache = dict()
        self._recursive_results = dict()

    def _goto(self, pos):
        self._buffer.goto(pos)

    def _next_token(self):
        self._buffer.next_token()

    @property
    def ast(self):
        return self._ast_stack[-1]

    @ast.setter
    def ast(self, value):
        self._ast_stack[-1] = value

    def name_last_node(self, name):
        self.ast[name] = self.last_node

    def add_last_node_to_name(self, name):
        self.ast.setlist(name, self.last_node)

    def _push_ast(self):
        self._push_cst()
        self._ast_stack.append(AST())

    def _pop_ast(self):
        self._pop_cst()
        return self._ast_stack.pop()

    @property
    def cst(self):
        return self._concrete_stack[-1]

    @cst.setter
    def cst(self, value):
        self._concrete_stack[-1] = value

    def _push_cst(self):
        self._concrete_stack.append(None)

    def _pop_cst(self):
        return self._concrete_stack.pop()

    def _add_cst_node(self, node):
        if node is None:
            return
        previous = self.cst
        if previous is None:
            self.cst = self._copy_node(node)
        elif is_list(previous):
            previous.append(node)
        else:
            self.cst = [previous, node]

    def _extend_cst(self, node):
        if node is None:
            return
        previous = self.cst
        if previous is None:
            self.cst = self._copy_node(node)
        elif is_list(node):
            if is_list(previous):
                previous.extend(node)
            else:
                self.cst = [previous] + node
        elif is_list(previous):
            previous.append(node)
        else:
            self.cst = [previous, node]

    def _copy_node(self, node):
        if node is None:
            return None
        elif is_list(node):
            return node[:]
        else:
            return node

    def _is_cut_set(self):
        return self._cut_stack[-1]

    def _cut(self):
        self._cut_stack[-1] = True

        # Kota Mizushima et al say that we can throw away
        # memos for previous positions in the buffer under
        # certain circumstances, without affecting the linearity
        # of PEG parsing.
        #   http://goo.gl/VaGpj
        #
        # We adopt the heuristic of always dropping the cache for
        # positions less than the current cut position. It remains to
        # be proven if doing it this way affects linearity. Empirically,
        # it hasn't.
        cutpos = self._pos

        def prune_cache(cache):
            prune_dict(cache, lambda k, _: k[0] < cutpos)

        prune_cache(self._memoization_cache)
        prune_cache(self._recursive_results)

    def _push_cut(self):
        self._cut_stack.append(False)

    def _pop_cut(self):
        return self._cut_stack.pop()

    def _enter_lookahead(self):
        self._lookahead += 1

    def _leave_lookahead(self):
        self._lookahead -= 1

    def _memoization(self):
        return self.memoize_lookaheads or self._lookahead == 0

    def _rulestack(self):
        stack = self.trace_separator.join(self._rule_stack)
        if len(stack) > self.trace_length:
            stack = '...' + stack[-self.trace_length:].lstrip(self.trace_separator)
        return stack

    def _find_rule(self, name):
        return None

    def _find_semantic_rule(self, name):
        if self.semantics is None:
            return None, None

        postproc = getattr(self.semantics, '_postproc', None)
        if not callable(postproc):
            postproc = None

        rule = getattr(self.semantics, safe_name(name), None)
        if callable(rule):
            return rule, postproc

        rule = getattr(self.semantics, '_default', None)
        if callable(rule):
            return rule, postproc

        return None, postproc

    def _trace(self, msg, *params):
        if self.trace:
            msg = msg % params
            info(ustr(msg), file=sys.stderr)

    def _trace_event(self, event):
        if self.trace:
            fname = ''
            if self.trace_filename:
                fname = self._buffer.line_info().filename + '\n'
            self._trace('%s   \n%s%s \n',
                        event + ' ' + self._rulestack(),
                        color.Style.DIM + fname,
                        color.Style.NORMAL + self._buffer.lookahead().rstrip('\r\n')
                        )

    def _trace_match(self, token, name=None, failed=False):
        if self.trace:
            fname = ''
            if self.trace_filename:
                fname = self._buffer.line_info().filename + '\n'
            name = '/%s/' % name if name else ''
            fgcolor = color.Fore.GREEN + '< 'if not failed else color.Fore.RED + '! '
            self._trace(
                color.Style.BRIGHT + fgcolor + '"%s" %s\n%s%s\n',
                token,
                name,
                color.Style.DIM + fname,
                color.Style.NORMAL + self._buffer.lookahead().rstrip('\r\n')
            )

    def _error(self, item, etype=FailedParse):
        raise etype(
            self._buffer,
            list(reversed(self._rule_stack[:])),
            item
        )

    def _fail(self):
        self._error('fail')

    def _get_parseinfo(self, node, name, start):
        return ParseInfo(
            self._buffer,
            name,
            start,
            self._pos
        )

    def _call(self, rule, name, params, kwparams):
        self._rule_stack.append(name)
        pos = self._pos
        try:
            self._trace_event(color.Fore.YELLOW + color.Style.BRIGHT + '>')
            self._last_node = None
            node, newpos, newstate = self._invoke_rule(rule, name, params, kwparams)
            self._goto(newpos)
            self._state = newstate
            self._trace_event(color.Fore.GREEN + color.Style.BRIGHT + '<')
            self._add_cst_node(node)
            self._last_node = node
            return node
        except FailedPattern:
            self._error('Expecting <%s>' % name)
        except FailedParse:
            self._trace_event(color.Fore.RED + color.Style.BRIGHT + '!')
            self._goto(pos)
            raise
        finally:
            self._rule_stack.pop()

    def _invoke_rule(self, rule, name, params, kwparams):
        cache = self._memoization_cache
        pos = self._pos

        key = (pos, rule, self._state)
        if key in cache:
            memo = cache[key]
            memo = self._left_recursion_check(name, key, memo)
            if isinstance(memo, Exception):
                raise memo
            return memo

        self._set_left_recursion_guard(name, key)
        self._push_ast()
        try:
            if name[0].islower():
                self._next_token()

            rule(self)

            node = self.ast
            if not node:
                node = self.cst
            elif '@' in node:
                node = node['@']  # override the AST
            elif self.parseinfo:
                node._parseinfo = self._get_parseinfo(
                    node,
                    name,
                    pos
                )

            node = self._invoke_semantic_rule(name, node, params, kwparams)
            result = (node, self._pos, self._state)

            result = self._left_recurse(rule, name, pos, key, result, params, kwparams)

            if self._memoization() and not self._in_recursive_loop():
                cache[key] = result
            return result
        except FailedParse as e:
            if self._memoization():
                cache[key] = e
            raise
        finally:
            self._pop_ast()

    def _set_left_recursion_guard(self, name, key):
        exception = FailedLeftRecursion(
            self._buffer,
            list(reversed(self._rule_stack[:])),
            name
        )

        # Alessandro Warth et al say that we can deal with
        # direct and indirect left-recursion by seeding the
        # memoization cache with a parse failure.
        #
        #   http://www.vpri.org/pdf/tr2007002_packrat.pdf
        #
        if self._memoization():
            self._memoization_cache[key] = exception

    def _left_recursion_check(self, name, key, memo):
        if isinstance(memo, FailedLeftRecursion) and self.left_recursion:
            # At this point we know we've already seen this rule
            # at this position. Either we've got a potential
            # result from a previous pass that we can return, or
            # we make a note of the rule so that we can take
            # action as we unwind the rule stack.

            if key in self._recursive_results:
                memo = self._recursive_results[key]
            else:
                self._recursive_head.append(name)
        return memo

    def _in_recursive_loop(self):
        head = self._recursive_head
        return head and head[-1] in self._rule_stack

    def _left_recurse(self, rule, name, pos, key, result, params, kwparams):
        if self._memoization():
            self._recursive_results[key] = result

        # If the current name is in the head, then we've just
        # unwound to the highest rule in the recursion
        cache = self._memoization_cache
        last_pos = pos
        if (
            [name] == self._recursive_head[-1:] and
            self._recursive_head[-1:] != self._recursive_eval[-1:]
        ):
            # Repeatedly apply the rule until it can't consume any
            # more. We store the last good result each time. Prior
            # to doing so we reset the position and remove any
            # failures from the cache.
            last_result = result
            self._recursive_eval.append(name)
            while self._pos > last_pos:
                last_result = result
                last_pos = self._pos
                self._goto(pos)
                prune_dict(cache, lambda _, v: isinstance(v, FailedParse))
                try:
                    result = self._invoke_rule(rule, name, params, kwparams)
                except FailedParse:
                    pass

            result = last_result
            self._recursive_results = dict()
            self._recursive_head.pop()
            self._recursive_eval.pop()
        return result

    def _invoke_semantic_rule(self, name, node, params, kwparams):
        semantic_rule, postproc = self._find_semantic_rule(name)
        try:
            if semantic_rule:
                node = semantic_rule(node, *(params or ()), **(kwparams or {}))
            if postproc is not None:
                postproc(self, node)
            return node
        except FailedSemantics as e:
            self._error(str(e), FailedParse)

    def _token(self, token):
        self._next_token()
        if self._buffer.match(token) is None:
            self._trace_match(token, failed=True)
            self._error(token, etype=FailedToken)
        self._trace_match(token)
        self._add_cst_node(token)
        self._last_node = token
        return token

    def _constant(self, literal):
        self._next_token()
        self._trace_match(literal)
        self._add_cst_node(literal)
        self._last_node = literal
        return literal

    def _pattern(self, pattern):
        token = self._buffer.matchre(pattern)
        if token is None:
            self._trace_match('', pattern, failed=True)
            self._error(pattern, etype=FailedPattern)
        self._trace_match(token, pattern)
        self._add_cst_node(token)
        self._last_node = token
        return token

    def _eof(self):
        return self._buffer.atend()

    def _eol(self):
        return self._buffer.ateol()

    def _check_eof(self):
        self._next_token()
        if not self._buffer.atend():
            self._error('Expecting end of text.')

    @contextmanager
    def _try(self):
        p = self._pos
        s = self._state
        ast_copy = self.ast.copy()
        self._push_ast()
        self.last_node = None
        try:
            self.ast = ast_copy
            yield
            ast = self.ast
            cst = self.cst
        except:
            self._goto(p)
            self._state = s
            raise
        finally:
            self._pop_ast()
        self.ast = ast
        self._extend_cst(cst)
        self.last_node = cst

    @contextmanager
    def _option(self):
        self.last_node = None
        self._push_cut()
        try:
            with self._try():
                yield
            raise OptionSucceeded()
        except FailedCut:
            raise
        except FailedParse as e:
            if self._is_cut_set():
                raise FailedCut(e)
        finally:
            self._pop_cut()

    @contextmanager
    def _choice(self):
        self.last_node = None
        with self._try():
            try:
                yield
            except OptionSucceeded:
                pass

    @contextmanager
    def _optional(self):
        self.last_node = None
        with self._choice():
            with self._option():
                yield

    @contextmanager
    def _group(self):
        self._push_cst()
        try:
            yield
            cst = self.cst
        finally:
            self._pop_cst()
        self._extend_cst(cst)
        self.last_node = cst

    @contextmanager
    def _if(self):
        p = self._pos
        s = self._state
        self._push_ast()
        self._enter_lookahead()
        try:
            yield
        finally:
            self._leave_lookahead()
            self._goto(p)
            self._state = s
            self._pop_ast()  # simply discard

    @contextmanager
    def _ifnot(self):
        try:
            with self._if():
                yield
        except FailedParse:
            pass
        else:
            self._error('', etype=FailedLookahead)

    @contextmanager
    def _ignore(self):
        self._push_cst()
        try:
            self.cst = None
            yield
        finally:
            self._pop_cst()

    def _repeater(self, block, prefix=None):
        while True:
            self._push_cut()
            self._push_cst()
            try:
                p = self._pos
                with self._try():
                    if prefix:
                        with self._ignore():
                            prefix()
                            self._cut()

                    block()
                    cst = self.cst

                    if self._pos == p:
                        self._error('empty closure')
            except FailedCut:
                raise
            except FailedParse as e:
                if self._is_cut_set():
                    raise FailedCut(e)
                break
            finally:
                self._pop_cst()
                self._pop_cut()
            self._add_cst_node(cst)

    def _closure(self, block):
        self._push_cst()
        try:
            self.cst = []
            self._repeater(block)
            cst = Closure(self.cst)
        finally:
            self._pop_cst()
        self._add_cst_node(cst)
        self.last_node = cst
        return cst

    def _positive_closure(self, block, prefix=None):
        self._push_cst()
        try:
            self.cst = None
            with self._try():
                block()
            self.cst = [self.cst]
            self._repeater(block, prefix=prefix)
            cst = Closure(self.cst)
        finally:
            self._pop_cst()
        self._add_cst_node(cst)
        self.last_node = cst
        return cst

    def _empty_closure(self):
        cst = Closure([])
        self._add_cst_node(cst)
        self.last_node = cst
        return cst

    def _check_name(self):
        name = self.last_node
        if (self.ignorecase and name.upper() or name) in self.keywords:
            raise FailedKeywordSemantics('"%s" is a reserved word' % name)


text:
<?php

/**
 * @file
 * Contains \Drupal\views\Annotation\ViewsArea.
 */

namespace Drupal\views\Annotation;

/**
 * Defines a Plugin annotation object for views area handlers.
 *
 * @see \Drupal\views\Plugin\views\area\AreaPluginBase
 *
 * @ingroup views_area_handlers
 *
 * @Annotation
 */
class ViewsArea extends ViewsHandlerAnnotationBase {

}


text:
.progress-indicator-shadow-stop-button {
  background-color: var(--color-accent-red);
  border: 0;
  width: 10px;
  height: 12px;
  border-radius: 2px;
}

.progress-indicator-shadow-container {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
}

.progress-indicator-shadow-container .title {
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 150px;
  margin-right: 2px;
  color: var(--color-text-secondary);
}

.progress-indicator-shadow-container progress {
  flex: auto;
  margin: 0 2px;
  width: 100px;
}


text:
module Stupidedi
  module Versions
    module FunctionalGroups
      module ThirtyForty
        module SegmentDefs

          s = Schema
          e = ElementDefs
          r = ElementReqs

          W76 = s::SegmentDef.build(:W76, "Total Shipping Order",
            "Total Shipping Order",
            e::E380 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
            e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
            e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
            e::E183 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
            e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
            e::E398 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

            SyntaxNotes::P.build(2, 3),
            SyntaxNotes::P.build(4, 5),
            SyntaxNotes::C.build(6, 3))

        end
      end
    end
  end
end


text:
using System;

namespace InControl
{
	public enum BindingSourceType : int
	{
		None = 0,
		DeviceBindingSource,
		KeyBindingSource,
		MouseBindingSource,
		UnknownDeviceBindingSource
	}
}


text:
package org.openntf.domino.nsfdata.structs.cd;

public enum FieldType {
	ERROR, NUMBER, TIME, RICH_TEXT, AUTHORS, READERS, NAMES, KEYWORDS, TEXT, SECTION, PASSWORD, FORMULA, TIMEZONE, UNUSED13, UNUSED14,
	UNUSED15, UNUSED16, UNUSED17, COLORCTL
}