Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
asn-1-generic-mode: A generic mode for ASN.1 (X.680) definitions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ivan Shmakov  
View profile  
 More options Nov 4 2012, 2:53 am
Newsgroups: alt.sources, gnu.emacs.sources
Followup-To: alt.sources.d, comp.emacs
From: Ivan Shmakov <oneing...@gmail.com>
Date: Sun, 04 Nov 2012 14:53:38 +0700
Local: Sun, Nov 4 2012 2:53 am
Subject: asn-1-generic-mode: A generic mode for ASN.1 (X.680) definitions
Archive-name: asn-1-generic-mode-is
Submitted-by: oneing...@gmail.com
Last-modified: 2012-11-04 +00:00
Copyright-Notice: Both the README and the code are under the
    CC0 Public Domain Dedication.

        The code below provides asn-1-generic-mode: a simplistic Emacs
        mode to edit Abstract Syntax Notation One (ASN.1) definitions,
        as per ITU-T X.680 [1].

        ASN.1 definitions are used to define (primarily binary, but also
        text- and XML-based) protocols and file formats independently of
        the implementation language, and may be considered a
        cross-language alternative to C language "struct" definitions.

        An example of an ASN.1 definition:

--- foo.asn.1 --- An ASN.1 definition example  -*- ASN-1-Generic -*-

Foo DEFINITIONS EXPLICIT TAGS ::=
BEGIN

FooSet ::= SET OF Foo

Foo ::= SEQUENCE {
    identifier  Identifier,
    name        Name

}

Identifier ::= CHOICE {
    nullId      NULL,
    integerId   INTEGER

}

Name ::= UTF8String

--- foo.asn.1 ends here

        Among the free software ASN.1 implementations are Convert::ASN1
        [2] and GNU Libtasn1 [3].

[1] http://www.itu.int/ITU-T/studygroups/com17/languages/X.680-0207.pdf
[2] http://search.cpan.org/dist/Convert-ASN1/
[3] http://www.gnu.org/software/libtasn1/

;;; asn1-generic.el --- Provide asn-1-generic-mode  -*- Emacs-Lisp -*-

;;; Ivan Shmakov, 2012

;; To the extent possible under law, the author(s) have dedicated all
;; copyright and related and neighboring rights to this software to the
;; public domain worldwide.  This software is distributed without any
;; warranty.

;; You should have received a copy of the CC0 Public Domain Dedication
;; along with this software.  If not, see
;; <http://creativecommons.org/publicdomain/zero/1.0/>.

;;; Code:

(define-generic-mode asn-1-generic-mode
  '("--" ("/*" . "*/"))
  ;; as per X.680, section 11.27
  '("ABSTRACT-SYNTAX"
    "ALL"
    "APPLICATION"
    "AUTOMATIC"
    "BEGIN"
    "BIT"
    "BMPString"
    "BOOLEAN"
    "BY"
    "CHARACTER"
    "CHOICE"
    "CLASS"
    "COMPONENT"
    "COMPONENTS"
    "CONSTRAINED"
    "CONTAINING"
    "DEFAULT"
    "DEFINITIONS"
    "EMBEDDED"
    "ENCODED"
    "END"
    "ENUMERATED"
    "EXCEPT"
    "EXPLICIT"
    "EXPORTS"
    "EXTENSIBILITY"
    "EXTERNAL"
    "FALSE"
    "FROM"
    "GeneralizedTime"
    "GeneralString"
    "GraphicString"
    "IA5String"
    "IDENTIFIER"
    "IMPLICIT"
    "IMPLIED"
    "IMPORTS"
    "INCLUDES"
    "INSTANCE"
    "INTEGER"
    "INTERSECTION"
    "ISO646String"
    "MAX"
    "MIN"
    "MINUS-INFINITY"
    "NULL"
    "NumericString"
    "OBJECT"
    "ObjectDescriptor"
    "OCTET"
    "OF"
    "OPTIONAL"
    "PATTERN"
    "PDV"
    "PLUS-INFINITY"
    "PRESENT"
    "PrintableString"
    "PRIVATE"
    "REAL"
    "RELATIVE-OID"
    "SEQUENCE"
    "SET"
    "SIZE"
    "STRING"
    "SYNTAX"
    "T61String"
    "TAGS"
    "TeletexString"
    "TRUE"
    "TYPE-IDENTIFIER"
    "UNION"
    "UNIQUE"
    "UNIVERSAL"
    "UniversalString"
    "UTCTime"
    "UTF8String"
    "VideotexString"
    "VisibleString"
    "WITH")
  '(("\\([A-Za-z0-9_]+\\)\\s-*::="
     (1 font-lock-variable-name-face)))
  '("\\.asn\\.?1\\'")
  nil
  "Generic mode for Abstract Syntax Notation One (ASN.1, X.680) files.")

;;; asn1-generic.el ends here

--
FSF associate member #7257


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »