World Library  
Flag as Inappropriate
Email this Article

Component Pascal

Component Pascal
Paradigm imperative, structured, modular, object-oriented
Designed by Oberon microsystems
First appeared 1997
Typing discipline strong, static
Influenced by

Component Pascal is a programming language in the tradition of Niklaus Wirth's Pascal,[1] Modula-2,[2] Oberon[3][4] and Oberon-2.[5] It bears the name of the Pascal programming language but is incompatible with it. Instead, it is a minor variant and refinement of Oberon-2, designed and supported by a small ETH Zürich spin-off company called Oberon microsystems. They developed an IDE (Integrated Development Environment) called BlackBox Component Builder. At the time the first version was released (1994 as Oberon/F) it presented a novel approach to graphical user interface (GUI) construction based on editable forms, where fields and command buttons are linked to exported variables and executable procedures. This approach bears some similarity to the code-behind way used in Microsoft's .NET 3.0 to access code in XAML.

An open-source implementation exists for the .NET and Java Virtual Machine platforms, from the Gardens Point team around John Gough at Queensland University of Technology in Australia.

On 23 June 2004 Oberon microsystems announced that the BlackBox Component Builder was made available as a free download and that an open-source version was planned. The beta open-source version was initially released in December, 2004 and updated to a final v1.5 release in December, 2005. It includes the complete source code of the IDE, compiler, debugger, source analyser, profiler and interfacing libraries and can also be downloaded from their website. Several release candidates for v1.6 appeared in the years 2009 – 2011, the latest one (1.6rc6) appeared on Oberon microsystems web pages in 2011. End of 2013 Oberon Microsystems released the final release 1.6. It is most probably last release bundled by Oberon Microsystems and a small community took over the ongoing development.

BlackBox Component Pascal uses the extensions .odc (= Oberon document) for document files, such as source files for example, and .osf (= Oberon symbol file) for symbol files while Gardens Point Component Pascal uses .cp for source and .cps for symbol files. BlackBox Component Pascal has its own executable and loadable object format .ocf (= Oberon code file); it includes a runtime linking loader for this format. The document format (.odc) is a rich text binary format, which allows nice formatting, supports conditional folding, and allows active content to be embedded in the source text. It also handles user interface elements in editable forms. This is in tradition of the Oberon Text format.[6]


  • Syntax 1
  • References 2
  • Evolution: Modula-2, Oberon, Oberon-2, Component Pascal 3
  • External links 4


The full syntax for CP, as given by the Language Report, is shown below. Note that in the extended Backus–Naur form only 34 grammatical productions are required, just one more than for Oberon-2, although it is a rather more advanced language.

Module = MODULE ident ";" 
           [ImportList] DeclSeq 
           [BEGIN StatementSeq] 
           [CLOSE StatementSeq] 
         END ident ".".

ImportList = IMPORT [ident ":="] ident {"," [ident ":="] ident} ";".

DeclSeq = { CONST {ConstDecl ";" } 
          | TYPE {TypeDecl ";"} 
          | VAR {VarDecl ";"}} 
          { ProcDecl ";" | ForwardDecl ";"}.

ConstDecl = IdentDef "=" ConstExpr.

TypeDecl = IdentDef "=" Type.

VarDecl = IdentList ":" Type.

ProcDecl = PROCEDURE [Receiver] IdentDef [FormalPars] MethAttributes 
           [";" DeclSeq [BEGIN StatementSeq] 
           END ident].

MethAttributes = ["," NEW] ["," (ABSTRACT | EMPTY | EXTENSIBLE)].

ForwardDecl = PROCEDURE "^" [Receiver] IdentDef [FormalPars] MethAttributes.

FormalPars = "(" [FPSection {";" FPSection}] ")" [":" Type].

FPSection = [VAR | IN | OUT] ident {"," ident} ":" Type.

Receiver = "(" [VAR | IN] ident ":" ident ")".

Type = Qualident
    | ARRAY [ConstExpr {"," ConstExpr}] OF Type
    | [ABSTRACT | EXTENSIBLE | LIMITED] RECORD ["("Qualident")"] FieldList {";" FieldList} END
    | POINTER TO Type
    | PROCEDURE [FormalPars].

FieldList = [IdentList ":" Type].

StatementSeq = Statement {";" Statement}.

Statement = [ Designator ":=" Expr
    | Designator ["(" [ExprList] ")"]
    | IF Expr THEN StatementSeq
        {ELSIF Expr THEN StatementSeq}
        [ELSE StatementSeq] 
    | CASE Expr OF 
        Case {"|" Case}
        [ELSE StatementSeq] 
    | WHILE Expr DO StatementSeq END
    | REPEAT StatementSeq UNTIL Expr
    | FOR ident ":=" Expr TO Expr [BY ConstExpr] DO StatementSeq END
    | LOOP StatementSeq END
    | WITH [ Guard DO StatementSeq ] 
       {"|" [ Guard DO StatementSeq ] } 
       [ELSE StatementSeq] 
    | EXIT
    | RETURN [Expr]

Case = [CaseLabels {"," CaseLabels} ":" StatementSeq].

CaseLabels = ConstExpr [".." ConstExpr].

Guard = Qualident ":" Qualident.

ConstExpr = Expr.

Expr = SimpleExpr [Relation SimpleExpr].

SimpleExpr = ["+" | "-"] Term {AddOp Term}.

Term = Factor {MulOp Factor}.

Factor = Designator | number | character | string | NIL | Set | "(" Expr ")" | " ~ " Factor.

Set = "{" [Element {"," Element}] "}".

Element = Expr [".." Expr].

Relation = "=" | "#" | "<" | "<=" | ">" | ">=" | IN | IS.

AddOp = "+" | "-" | OR.

MulOp = "*" | "/" | DIV | MOD | "&".

Designator = Qualident {"." ident 
             | "[" ExprList "]" 
             | "^" 
             | "(" Qualident ")" 
             | "(" [ExprList] ")"} [ "$" ].

ExprList = Expr {"," Expr}.

IdentList = IdentDef {"," IdentDef}.

Qualident = [ident "."] ident.

IdentDef = ident ["*" | "-"].


  1. ^ Jensen, Kathleen & Wirth, Niklaus. Pascal: User Manual And Report. Springer Verlag 1974, 1985, 1991. ISBN 978-0-387-97649-5 (1991)
  2. ^ Wirth, Niklaus. Programming in Modula-2. Springer Verlag 1982, 1983, 1985. ISBN 978-3-540-15078-7 ISBN 0-387-15078-1
  3. ^ Reiser, Martin & Wirth, Niklaus. Programming in Oberon. Addison Wesley, 1992. ISBN 0-201-56543-9 PDF (334 KB)
  4. ^ Wirth, Niklaus & Gutknecht, Jürg. Project Oberon: The Design of an Operating System and Compiler. Addison Wesley, 1992 ISBN 0-201-54428-8 PDF (4'398 KB)
  5. ^ Mössenböck, Hans-Peter & Wirth, Niklaus. "The Programming Language Oberon-2". Structured Programming (1991) 12:179-195.
  6. ^ Mössenböck, H. and Koskimies, K. (1996), Active Text for Structuring and Understanding Source Code. Softw: Pract. Exper., 26: 833–850. doi: 10.1002/(SICI)1097-024X(199607)26:7<833::AID-SPE34>3.0.CO;2-Q.

Evolution: Modula-2, Oberon, Oberon-2, Component Pascal

  • From Modula to Oberon Wirth (1990)
  • The Programming Language Oberon Wirth (1990)
  • Differences between Oberon and Oberon-2 Mössenböck and Wirth (1993)
  • The Programming Language Oberon-2 H. Mössenböck, N. Wirth, Institut für Computersysteme, ETH Zürich (ETHZ), January 1992.
  • What's New in Component Pascal (changes from Oberon-2 to CP), Pfister (2001)

External links

  • Oberon microsystems
  • Component Pascal Language Report
  • What's new in Component Pascal?
  • More Information / Download the BlackBox Component Builder
  • Open-Source License for the framework Vs. 1.5-1.6rc6 and Vs. 1.6
  • Gardens Point Component Pascal at QUT – PLAS (latest available archived version in
  • Gardens Point Component Pascal at CodePlex
  • Component Pascal Collection with many useful sources
  • Component Pascal Resources
  • Component Pascal at DMOZ
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.