From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +GArIU/l+WUKFwEA62LTzQ:P1 (envelope-from ) for ; Tue, 19 Mar 2024 20:19:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id +GArIU/l+WUKFwEA62LTzQ (envelope-from ) for ; Tue, 19 Mar 2024 20:19:43 +0100 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=SbC500UK; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=JwVOFOt3; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1710875983; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=cTz7J2xaRxZjDzJ/e/iHSoOGnlR/08nMvTaEZsgLfA8=; b=n+Z8282RPlgyAdsbLStNLOFamiVemvwEQy7nfgA+EwrlEzl3Sjso5+zUsGDqV+97WZqLWh icZ+Q7t2cvR8KT8RZpSElvtyx5LNo3GfnJhu+eFrqH3cfVhFUW63yWbseb/TlnnZmrM0rM v+rcV6TV9LL0um8UNc5od77sPYbcMPV2UQP6zSJQhYXjreJXWPWFLCSv3v7vRKTIMa1+k5 QKwM4J8INwdV0T2UI8W4T3thQEqzJTWLfva5AzJfyC7mgHtCI32MMUXLuf7CCYTZmvaceK 23rWqwZyJUo35LO/l22FeuvDPJ7jzyp2rhDwqgJeRAq/NYugt20Ukxq/Joptmg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=SbC500UK; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=JwVOFOt3; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht ARC-Seal: i=1; s=key1; d=johnnyrichard.com; t=1710875983; a=rsa-sha256; cv=none; b=uGS6TKscUu2rAE0lQmhRRXMXlR3XM/f/FwSH/ne/igir0qdtPJvlKo6jSuHb6M6qK3UTnn HHB63ssRrB/S+x/6BnDtvG6v5XaGbhSA+1h81qn5MgoibM4RJnebfM5Ro32t5E47JXjAPP 1hg7GCR3gZ6P7mNFIhbTVekXdx3ZtJINTHlYqlLHsbyS58n9t71qiQlWpukEiL2dXieXUF 7mjsm76WvVk+Oo+g+dK1toguvo3qyLmNhsacqzaxtfgmE2psjyE2ukYhGUTjSs8nf+xSlA xC9+EaROQ6grxGdLeDvCVqqUvMEY8wq9sENrKAMaAXxEhFC5hwnYAJaUA36V6g== Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 42E2C68EFD for ; Tue, 19 Mar 2024 20:19:43 +0100 (CET) DKIM-Signature: a=rsa-sha256; bh=nPEz10IruUy8RI/2vD2X53318Y8qGf4+tac/xUdc+TQ=; c=simple/simple; d=lists.sr.ht; h=From:To:Cc:Subject:Date:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1710875982; v=1; b=SbC500UKSjmwJtHscGhY9nNxU3OnarHPIWXKvGWrbOgg/kedkr9Oi9GhCyATbwrh9WE4S4dc Bxp3gKkDYHpOQDdNNhV+0GTzY16Gq+A7rWAjvI6+hRqMl8xcN+XWqtEcEaWI66cGaejjvG+YIva UlAHbfF0ye7BWZEx0l5fAfMuMMjFms0YfUjiBOzvWaBQw9BTV46JiZZ1BxWOJXpk/g1Jb6xv7P0 M5Q4SNAuU2R2ZO7TEhkqe2CwNW/Y4D7v4aT4ZXUgI7QZQhj+LiBY1lOc10qlB/JY4PNhmzRku8C +x6VsNJr2k/YrdaJarmvJi24ltpomkgiS9oQCC32tRt7w== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id BA3C7200DD for ; Tue, 19 Mar 2024 19:19:42 +0000 (UTC) Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) by mail-a.sr.ht (Postfix) with ESMTPS id 20418200D0 for <~johnnyrichard/olang-devel@lists.sr.ht>; Tue, 19 Mar 2024 19:19:42 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1710875981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=cTz7J2xaRxZjDzJ/e/iHSoOGnlR/08nMvTaEZsgLfA8=; b=JwVOFOt3HFsWRGo9IPHbbXMdszezsUNCtKihCFpTH2z4JlDkfHVFBkmNS+7J0Dg4jYRNbZ 5blSWXCAPg517B5sxfH1uZzNfdi10PXt1b4kxJZFbcwb0C3QMtwFf5M3ulNkusm1yB4NTW stb0ycglYqkln1jHaDqWI7wy65CRqIvgH6SNfep/aEFKH/l6NLWoy8kUlmkkE4nQ3RsOAY hICoWHO/NWHFYFsiIfPR4PGRCcH5mBarrAbMy05er7FkqcT50Kmvtfl5DixS2gxgHBq6rJ xWjNYxsKsZwUeqKBUsYgzZGsBlNegnWQH1F5+lHoSuaneXYLJ0wGCMOozZnKcQ== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard , Ricardo Kagawa Subject: [PATCH olang v2] docs: create o programming language spec Date: Tue, 19 Mar 2024 21:18:44 +0100 Message-ID: <20240319201927.204086-1-johnny@johnnyrichard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Sourcehut-Patchset-Status: PROPOSED List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Country: NL X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -9.08 X-Spam-Score: -9.08 X-Migadu-Queue-Id: 42E2C68EFD X-Migadu-Scanner: mx11.migadu.com X-TUID: IYmBP+chZMVO This document specifies the semantics and behavior of the O Programming Language for compiler designers be informed on how the language is designed. This document will help newcomers to understand how the language looks like and also as a DRAFT guide to drive design discussions. The grammar was made by using a EBNF evaluator tool[1]. [1]: The live example https://mdkrajnak.github.io/ebnftest/ and a locked version https://github.com/Engelberg/instaparse/tree/v1.4.12 as reference. Signed-off-by: Johnny Richard --- docs/pages/language-specification.md | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 docs/pages/language-specification.md diff --git a/docs/pages/language-specification.md b/docs/pages/language-specification.md new file mode 100644 index 0000000..17e6eed --- /dev/null +++ b/docs/pages/language-specification.md @@ -0,0 +1,65 @@ +O programming language specification +==================================== + +ABSTRACT +-------- + +This document specifies the semantics and behavior of the O Programming +Language for compiler designers be informed how the language is designed. + +This specification is a DRAFT and will be the discussions drive over olang-dev +mailing list. + +Language Syntax +--------------- + +This is the O Programming Language EBNF grammar specification[1] + +[1]: EBNF variant https://github.com/Engelberg/instaparse/tree/v1.4.12 and live + test can be accessed here https://mdkrajnak.github.io/ebnftest/ + +NOTE: This grammar spec is a DRAFT and it covers only a small portion of the +language. + +``` +(* Entry Point *) + ::= + +(* Functions *) + ::= 'fn' + ':' + ::= + ::= '(' ')' + ::= + ::= + +(* Statements *) + ::= '{' ( + )* ? '}' + ::= ';' | + ::= + ::= 'return' + +(* Expressions *) + ::= + +(* Identifiers *) + ::= 'u32' + ::= ( | '_') ( | | '_')* + +(* Literals *) + ::= | + ::= #'[1-9]' ( | '_')* | '0' + ::= #'0[Xx]' ( | '_')* + +(* Utilities *) + ::= + + ::= * + ::= | + ::= #'[\n\v\f\r]' | '\r\n' + ::= #'[ \t]' + ::= #'[a-zA-Z]' + ::= #'[0-9]' + ::= | #'[a-fA-F]' + ::= #'$' +``` -- 2.44.0