This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict On | |
Imports System.Runtime.InteropServices | |
''' <summary> | |
''' 「ちょっとマウスカーソルの位置ってどうやって取得するのさ!」って言われたので、 | |
''' マウスカーソルの座標を取得するサンプルです。 | |
''' VBなら10分もあれば簡単に組めるよ!よ! | |
''' </summary> | |
''' <remarks>経過時間(m_Countrer)のところは、(VBのTimerが適当なため)だいぶずれています。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'言語を作るなら、言語の仕様を再確認! | |
Module Module1 | |
Public Function Test() As String | |
Return "Hello from Method" | |
End Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' <summary> | |
''' 変数/引数管理用の補助クラス(VBPP_Variable、及びその派生の中で使用) | |
''' </summary> | |
''' <remarks></remarks> | |
Public Class VBPP_VariableType | |
''' <summary> | |
''' ユーザー定義のもの(クラスや構造体など)か、そうでないか | |
''' </summary> | |
Public DefineType As VBPP_DefineType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'どちらのほうが、パーサーから見ると、扱いやすいのでしょうか...? | |
'1.)VBCPP_Statementを継承したクラスに、直に処理内容をつける。 | |
'2.)VBCPP_Statementを継承したクラスにはVBCPP_IfStatementのクラスを結びつけるだけで、 | |
' 処理内容は、単独のVBCPP_IfStatementクラスにつける。 | |
'1.)の実装例 | |
Public Class IfStatement | |
Inherits VBCPP_Statement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict On | |
Module Module1 | |
Sub Main() | |
'わかりやすくするために、一旦宣言 | |
Dim str As String | |
'ここを知りたい! | |
str = GenerateClass("bonpro").GetGreeting | |
'出力 ->結果: Hello,bonpro | |
Console.WriteLine(str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict On | |
Module Module1 | |
Sub Main() | |
Dim TestClass As New TestClass | |
'<Output> Test.TestClass ->クラスが読み込まれた(同じ階層の変数名を発見して処理が終わった) | |
Console.WriteLine(TestClass.ToString) | |
'<Output> Function.TestClass ->関数が読み込まれた(1つ階層が上がったところで処理が終わった) | |
Console.WriteLine(TestClass2.ToString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict On | |
'今回は単に編集した情報を拾うだけなので、非常に原始的な方法でやってます...! | |
'(記事: http://www.bonprosoft.com/modules/blog/?p=282 ) | |
Public Class Form1 | |
Public WithEvents oSkype As SKYPE4COMLib.Skype | |
Private m_status As ReplyStatus | |
Private m_timeStamp As Integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports VBCPP | |
Imports VBCPPPlugin | |
Imports VBCPPPlugin.Tables | |
Imports VBCPPPlugin.AST | |
Imports VBCPPPlugin.AST.AST_Class | |
Imports VBCPPPlugin.AST.AST_Enum | |
Module HelloWorld | |
Sub Main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&&entry = "Main" | |
&&<code language="VB"> | |
Public Sub Main() | |
Console.WriteLine("VB: Hello,World! Hey,Brainf**k!") | |
Console.Write("Brainf**k: ") | |
'Brainf**kのプログラムを呼び出します | |
BFHello() | |
End Sub | |
&&</code> | |
&&<comment>Hello,World!を出力した後、echoを行います。</comment> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' ポイントはNewを殆ど使わず、メソッドチェーンで内容を付与していく点です。 | |
' この式では、なるべくカッコは使いたくなかったので、リストなどを作る際、子を作り終わったらDefineで親に戻ります。 | |
' LINQに触れてみて、感動したので、それに影響されたところがあります。 | |
'★長所: (他の式に比べて)なかなか書きやすい!★ | |
'★短所: Defineをしないうちは、別の中間生成物として表される必要が有るため、クラスが結構増える | |
Dim tree As New VBCPP_Program | |
tree.AddMethod( _ | |
VBCPP_Method.CreateNew("SampleMethod",System.Reflection.MethodAttributes.Static Or Reflection.MethodAttributes.Public,LangName,Line,FileName) _ | |
.SetBody _ |
OlderNewer