Mercurial > hg > Document > Growi
changeset 24:f0bc0289de97
backup 2021-01-16
author | autobackup |
---|---|
date | Sat, 16 Jan 2021 00:10:03 +0900 |
parents | 6f9bfbfc54c9 |
children | c25e1386e469 |
files | user/anatofuz/note/2021/01/15.md |
diffstat | 1 files changed, 72 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/user/anatofuz/note/2021/01/15.md Sat Jan 16 00:10:03 2021 +0900 @@ -0,0 +1,72 @@ +# c/extern.h + +- `__code`のexternが並んでいるやつ + - gccの場合のプロトタイプ宣言避け + - ここはgenricsの`<>`が埋め込まれてしまうので更新する必要がある + - `.c`自体を書き換えてしまえばいらない説 + +- enum関係 + - あんま関係ない + +```perl +[ + [0] { + name "AtomicT", + typed_variable [ + [0] { + type "T", + vname "newData" + }, + [1] { + type "T", + vname "init" + } + ] + }, + [1] { + name "AtomicT", + typed_variable [ + [0] { + type "T", + vname "atomic" + }, + [1] { + type "T", + vname "init" + } + ] + }, + [2] { + generics [ + [0] { + generics "int", + type "AtomicT", + vname "Leftfork" + }, + [1] { + generics "int", + type "AtomicT", + vname "Rightfork" + } + ], + name "Phils" + } +] +``` + +```perl +use strict; +use warnings; + +my $line = 'AtomicT<int> fork0 = setAtomicT(int)'; + + + if ($line =~ /^\s*(\w+)<(.+)>\*?\s*(\w+)\s*=\s*(.+)\(?/) { + my $interface = $1; + my $generics = $2; + my $method = $3; + + print "interface $interface\n"; + print "generics $generics\n"; + } +```